nus-yam/ex-repair huggingface dataset:
Program: 151826
Project: 151826
Buggy source:
public AreaStoragePair playerArea(Player player){
  String name=player.getName().toLowerCase();
  for (  DimensionConfig dim : dimensions) {
    Stack<AreaStorage> stack=new Stack<AreaStorage>();
    stack.add(dim.topAreas);
    while (!stack.isEmpty()) {
      for (      Area area : stack.peek()) {
        if (area.owner == name) {
          return new AreaStoragePair(stack.peek(),area);
        }
        stack.add(area.areas);
      }
      stack.pop();
    }
  }
  return null;
}

Fixed version (ground truth):
public AreaStoragePair playerArea(Player player){
  String name=player.getName().toLowerCase();
  for (  DimensionConfig dim : dimensions) {
    Stack<AreaStorage> stack=new Stack<AreaStorage>();
    stack.add(dim.topAreas);
    while (!stack.isEmpty()) {
      AreaStorage storage=stack.pop();
      for (      Area area : storage) {
        if (area.owner == name) {
          return new AreaStoragePair(storage,area);
        }
        stack.add(area.areas);
      }
    }
  }
  return null;
}
Program: 151827
Project: 151827
Buggy source:
public DimensionConfig add(Dimension dimension){
  DimensionConfig newDimension=new DimensionConfig();
  newDimension.dimension=dimension;
  dimensions.put(dimension,newDimension);
  return newDimension;
}

Fixed version (ground truth):
public DimensionConfig add(Dimension dimension){
  DimensionConfig newDimension=new DimensionConfig();
  newDimension.dimension=dimension;
  newDimension.init();
  dimensions.put(dimension,newDimension);
  return newDimension;
}
Program: 151828
Project: 151828
Buggy source:
public Set<Area> overlaps(Area area){
  DimensionConfig dim=get(area.start.dimension());
  if (dim != null) {
    return dim.areas.overlaps(area);
  }
  return null;
}

Fixed version (ground truth):
public Set<Area> overlaps(Area area){
  DimensionConfig dim=get(area.start.dimension());
  if (dim != null) {
    return dim.areas.overlaps(area);
  }
  return new HashSet<Area>(0);
}
Program: 151829
Project: 151829
Buggy source:
@Override public void save(){
  lock.lock();
  FileOutputStream fos;
  try {
    fos=new FileOutputStream(new File("String_Node_Str"));
  }
 catch (  FileNotFoundException e) {
    e.printStackTrace();
    lock.unlock();
    return;
  }
  OutputFormat of=new OutputFormat("String_Node_Str","String_Node_Str",true);
  of.setIndent(1);
  of.setIndenting(true);
  of.setDoctype(null,"String_Node_Str");
  XMLSerializer serializer=new XMLSerializer(fos,of);
  ContentHandler hd;
  try {
    hd=serializer.asContentHandler();
    hd.startDocument();
    config.save(hd,serializer);
    hd.endDocument();
    fos.close();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
 finally {
    lock.unlock();
  }
}

Fixed version (ground truth):
@Override public void save(){
  lock.lock();
  FileOutputStream fos;
  try {
    fos=new FileOutputStream(getFile());
  }
 catch (  FileNotFoundException e) {
    e.printStackTrace();
    lock.unlock();
    return;
  }
  OutputFormat of=new OutputFormat("String_Node_Str","String_Node_Str",true);
  of.setIndent(1);
  of.setIndenting(true);
  of.setDoctype(null,"String_Node_Str");
  XMLSerializer serializer=new XMLSerializer(fos,of);
  ContentHandler hd;
  try {
    hd=serializer.asContentHandler();
    hd.startDocument();
    config.save(hd,serializer);
    hd.endDocument();
    fos.close();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
 finally {
    lock.unlock();
  }
}
Program: 151830
Project: 151830
Buggy source:
public Integer get(Player player){
  return get(player.getInetAddress()).group;
}

Fixed version (ground truth):
public Integer get(Player player){
  return contains(player.getInetAddress()) ? get(player.getInetAddress()).group : null;
}
Program: 151831
Project: 151831
Buggy source:
private static boolean contains(TreeMap<Integer,Integer> ranges,int value){
  Entry<Integer,Integer> entry=ranges.lowerEntry(value + 1);
  return entry != null && entry.getValue() <= value;
}

Fixed version (ground truth):
private static boolean contains(TreeMap<Integer,Integer> ranges,int value){
  Entry<Integer,Integer> entry=ranges.lowerEntry(value + 1);
  return entry != null && entry.getValue() >= value;
}
Program: 151832
Project: 151832
Buggy source:
private Area createPlayerArea(Player player){
  Area area=new Area(t("String_Node_Str",player.getName()),player.areastart,player.areaend);
  area.owner=player.getName().toLowerCase();
  return area;
}

Fixed version (ground truth):
private Area createPlayerArea(Player player){
  Area area=new Area(t("String_Node_Str",player.getName()),player.areastart,player.areaend);
  area.owner=player.getName().toLowerCase();
  Permission perm=new Permission(player);
  AllBlocks blocks=new AllBlocks();
  blocks.destroy=perm;
  blocks.place=perm;
  blocks.use=perm;
  area.allblocks.blocks=blocks;
  area.chests.chests=new Chests(perm);
  return area;
}
Program: 151833
Project: 151833
Buggy source:
@Override void add(XMLTag child){
  AllBlocks blocks=(AllBlocks)child;
  if (this.blocks == null) {
    this.blocks=blocks;
  }
 else {
    if (blocks.place != null) {
      this.blocks.place=blocks.place;
    }
    if (blocks.destroy != null) {
      this.blocks.destroy=blocks.destroy;
    }
    if (blocks.use != null) {
      this.blocks.use=blocks.use;
    }
    if (blocks.take != null) {
      this.blocks.take=blocks.take;
    }
    if (blocks.give != null) {
      this.blocks.give=blocks.give;
    }
  }
}

Fixed version (ground truth):
@Override public void add(XMLTag child){
  AllBlocks blocks=(AllBlocks)child;
  if (this.blocks == null) {
    this.blocks=blocks;
  }
 else {
    if (blocks.place != null) {
      this.blocks.place=blocks.place;
    }
    if (blocks.destroy != null) {
      this.blocks.destroy=blocks.destroy;
    }
    if (blocks.use != null) {
      this.blocks.use=blocks.use;
    }
    if (blocks.give != null) {
      this.blocks.give=blocks.give;
    }
  }
}
Program: 151834
Project: 151834
Buggy source:
public Area(String name,Coordinate start,Coordinate end){
  this();
  this.name=name;
  this.start=start;
  this.end=end;
  position=Integer.MAX_VALUE;
  level=0;
  init();
}

Fixed version (ground truth):
public Area(String name,Coordinate start,Coordinate end){
  this();
  this.name=name;
  this.start=start;
  this.end=end;
  position=Integer.MAX_VALUE;
  level=0;
  init();
  finish();
}
Program: 151835
Project: 151835
Buggy source:
@Override public void finish(){
  DimensionAreaStorage.getInstance().decreaseLevel();
}

Fixed version (ground truth):
@Override public void finish(){
  DimensionAreaStorage.getInstance().decreaseLevel();
  super.finish();
}
Program: 151836
Project: 151836
Buggy source:
Chests(){
  super("String_Node_Str");
}

Fixed version (ground truth):
public Chests(Permission permission){
  this();
  allow=permission;
}
Program: 151837
Project: 151837
Buggy source:
public Group getGroup(Player player) throws SAXException {
  Integer playerGroup=players.get(player);
  Integer ipGroup=ips.get(player);
  int groupid;
  if (playerGroup == null && ipGroup == null) {
    groupid=properties.getInt("String_Node_Str");
  }
 else   if (playerGroup == null || playerGroup < ipGroup) {
    groupid=ipGroup;
  }
 else {
    groupid=playerGroup;
  }
  Group group=groups.get(groupid);
  if (group == null) {
    throw new SAXException("String_Node_Str" + groupid + "String_Node_Str");
  }
  return group;
}

Fixed version (ground truth):
public Group getGroup(Player player) throws SAXException {
  Integer playerGroup=players.get(player);
  Integer ipGroup=ips.get(player);
  int groupid;
  if (playerGroup == null && ipGroup == null) {
    groupid=properties.getInt("String_Node_Str");
  }
 else   if (playerGroup == null || (ipGroup != null && playerGroup < ipGroup)) {
    groupid=ipGroup;
  }
 else {
    groupid=playerGroup;
  }
  Group group=groups.get(groupid);
  if (group == null) {
    throw new SAXException("String_Node_Str" + groupid + "String_Node_Str");
  }
  return group;
}
Program: 151838
Project: 151838
Buggy source:
public AreaStoragePair playerArea(Player player){
  String name=player.getName().toLowerCase();
  for (  DimensionConfig dim : dimensions) {
    Stack<AreaStorage> stack=new Stack<AreaStorage>();
    stack.add(dim.topAreas);
    while (!stack.isEmpty()) {
      AreaStorage storage=stack.pop();
      for (      Area area : storage) {
        if (area.owner.equals(name)) {
          return new AreaStoragePair(storage,area);
        }
        stack.add(area.areas);
      }
    }
  }
  return null;
}

Fixed version (ground truth):
public AreaStoragePair playerArea(Player player){
  String name=player.getName().toLowerCase();
  for (  DimensionConfig dim : dimensions) {
    Stack<AreaStorage> stack=new Stack<AreaStorage>();
    stack.add(dim.topAreas);
    while (!stack.isEmpty()) {
      AreaStorage storage=stack.pop();
      for (      Area area : storage) {
        if (name.equals(area.owner)) {
          return new AreaStoragePair(storage,area);
        }
        stack.add(area.areas);
      }
    }
  }
  return null;
}
Program: 151839
Project: 151839
Buggy source:
void decreaseLevel(){
  positions.pop();
}

Fixed version (ground truth):
void decreaseLevel(){
  if (positions != null && !positions.isEmpty()) {
    positions.pop();
  }
}
Program: 151840
Project: 151840
Buggy source:
@Override public void load(){
  lock.lock();
  loadsuccess=false;
  InputStream stream;
  if (!getFile().exists()) {
    Config config;
    if ((config=LegacyPermissionConfig.load()) != null) {
      this.config=config;
      loadsuccess=true;
      return;
    }
 else {
      stream=getClass().getResourceAsStream(filename);
    }
  }
 else {
    try {
      stream=new FileInputStream(getFile());
    }
 catch (    FileNotFoundException e) {
      e.printStackTrace();
      lock.unlock();
      return;
    }
  }
  XMLReader xml;
  try {
    xml=XMLReaderFactory.createXMLReader();
  }
 catch (  SAXException e) {
    e.printStackTrace();
    lock.unlock();
    return;
  }
  XMLTagResolver handler;
  try {
    handler=new XMLTagResolver();
  }
 catch (  SAXException e1) {
    e1.printStackTrace();
    return;
  }
  xml.setContentHandler(handler);
  xml.setErrorHandler(handler);
  try {
    xml.setFeature("String_Node_Str",true);
    xml.setEntityResolver(handler);
    xml.parse(new InputSource(new InputStreamReader(stream)));
  }
 catch (  Exception e) {
    e.printStackTrace();
    lock.unlock();
    return;
  }
  processTags(handler.root());
  loadsuccess=true;
  lock.unlock();
}

Fixed version (ground truth):
@Override public void load(){
  lock.lock();
  loadsuccess=false;
  InputStream stream;
  if (!getFile().exists()) {
    Config config;
    if ((config=LegacyPermissionConfig.load()) != null) {
      this.config=config;
      loadsuccess=true;
      return;
    }
 else {
      stream=getClass().getResourceAsStream(filename);
    }
  }
 else {
    try {
      stream=new FileInputStream(getFile());
    }
 catch (    FileNotFoundException e) {
      e.printStackTrace();
      lock.unlock();
      return;
    }
  }
  XMLReader xml;
  try {
    xml=XMLReaderFactory.createXMLReader();
  }
 catch (  SAXException e) {
    e.printStackTrace();
    lock.unlock();
    return;
  }
  XMLTagResolver handler;
  try {
    handler=new XMLTagResolver();
  }
 catch (  SAXException e1) {
    e1.printStackTrace();
    return;
  }
  xml.setContentHandler(handler);
  xml.setErrorHandler(handler);
  try {
    xml.setFeature("String_Node_Str",true);
    xml.setEntityResolver(handler);
    xml.parse(new InputSource(new InputStreamReader(stream)));
  }
 catch (  Exception e) {
    e.printStackTrace();
    lock.unlock();
    return;
  }
  processTags(handler.root());
  loadsuccess=true;
  save();
  lock.unlock();
}
Program: 151841
Project: 151841
Buggy source:
public Permission(String allow,String disallow) throws SAXException {
  if (disallow == null) {
    disallow="String_Node_Str";
  }
  if (allow == null) {
    allow="String_Node_Str";
  }
  String[] allowParts=allow.split("String_Node_Str");
  String[] disallowParts=disallow.split("String_Node_Str");
  StringBuilder perm=new StringBuilder(allowParts[0]);
  for (  String part : disallowParts[0].split("String_Node_Str")) {
    if (part.length() == 0) {
      continue;
    }
    perm.append(',');
    perm.append('!');
    perm.append(part);
  }
  if (allowParts[0].length() == 0) {
    perm.deleteCharAt(0);
  }
  if (allowParts.length >= 2 || disallowParts.length >= 2) {
    perm.append(';');
    if (allowParts.length >= 2) {
      perm.append(allowParts[1]);
    }
    if (disallowParts.length >= 2) {
      for (      String part : disallowParts[1].split("String_Node_Str")) {
        if (perm.charAt(perm.length() - 1) != ';') {
          perm.append(',');
        }
        perm.append('!');
        perm.append(part);
      }
    }
  }
  set(perm.toString());
}

Fixed version (ground truth):
public Permission(Player player){
  allowedPlayers.add(player.getName().toLowerCase());
}
Program: 151843
Project: 151843
Buggy source:
@Override void convert(Attributes attributes,Stack<PermissionContainer> stack) throws SAXException {
  PermissionContainer container=stack.peek();
  Block block=new Block(attributes.getValue("String_Node_Str"));
  block.place=new Permission(attributes.getValue("String_Node_Str"));
  block.fullInit();
  container.blocks.add(block);
}

Fixed version (ground truth):
@Override void convert(Attributes attributes,Stack<PermissionContainer> stack) throws SAXException {
  PermissionContainer container=stack.peek();
  Block block=new Block(attributes.getValue("String_Node_Str"));
  block.place=new Permission(attributes.getValue("String_Node_Str"),attributes.getValue("String_Node_Str"));
  block.fullInit();
  container.blocks.add(block);
}
Program: 151844
Project: 151844
Buggy source:
public boolean parseCommand(String line){
  ServerCommand command=server.getCommandParser().getServerCommand(line);
  if ((command != null) && (command.getClass() != InvalidCommand.class)) {
    command.execute(server,line);
    return !command.shouldPassThroughToConsole(server);
  }
  return false;
}

Fixed version (ground truth):
public boolean parseCommand(String line){
  ServerCommand command=server.getCommandParser().getServerCommand(line.split("String_Node_Str")[0]);
  if ((command != null) && !(command instanceof InvalidCommand)) {
    command.execute(server,line);
    return !command.shouldPassThroughToConsole(server);
  }
  return false;
}
Program: 151845
Project: 151845
Buggy source:
public boolean loadResources(){
  for (  Resource resource : resources) {
    resource.load();
  }
  if (playerList != null) {
    playerList.updatePlayerGroups();
  }
  if (globalConfig.loadsuccess) {
    config=globalConfig.config;
  }
 else {
    System.out.println("String_Node_Str");
  }
  if (!Translations.getInstance().setLanguage(options.get("String_Node_Str"))) {
    options.set("String_Node_Str","String_Node_Str");
    options.save();
  }
  addressFactory.toggle(!options.getBoolean("String_Node_Str"));
  return globalConfig.loadsuccess;
}

Fixed version (ground truth):
public boolean loadResources(){
  for (  Resource resource : resources) {
    resource.load();
  }
  if (globalConfig.loadsuccess) {
    config=globalConfig.config;
  }
 else {
    System.out.println("String_Node_Str");
  }
  if (playerList != null) {
    playerList.updatePlayerGroups();
  }
  if (!Translations.getInstance().setLanguage(options.get("String_Node_Str"))) {
    options.set("String_Node_Str","String_Node_Str");
    options.save();
  }
  addressFactory.toggle(!options.getBoolean("String_Node_Str"));
  return globalConfig.loadsuccess;
}
Program: 151846
Project: 151846
Buggy source:
public void execute(Player player,String message){
  List<Area> areas=player.getServer().config.dimensions.areas(player.position());
  StringBuilder str=new StringBuilder();
  for (  Area area : areas) {
    str.append(area.name);
    str.append("String_Node_Str");
  }
  if (!areas.isEmpty()) {
    str.delete(str.length() - 2,str.length() - 1);
  }
  player.addTMessage(Color.GRAY,"String_Node_Str",Color.WHITE,str.toString());
}

Fixed version (ground truth):
public void execute(Player player,String message){
  List<Area> areas=player.getServer().config.dimensions.areas(player.position());
  StringBuilder str=new StringBuilder();
  if (areas == null || areas.isEmpty()) {
    player.addTMessage(Color.GRAY,"String_Node_Str");
    return;
  }
  for (  Area area : areas) {
    str.append(area.name);
    str.append("String_Node_Str");
  }
  if (!areas.isEmpty()) {
    str.delete(str.length() - 2,str.length() - 1);
  }
  player.addTCaptionedMessage("String_Node_Str",str.toString());
}
Program: 151849
Project: 151849
Buggy source:
public AreaStoragePair playerArea(Player player){
  String name=player.getName().toLowerCase();
  for (  DimensionConfig dim : dimensions) {
    Stack<AreaStorage> stack=new Stack<AreaStorage>();
    stack.add(dim.topAreas);
    while (!stack.isEmpty()) {
      AreaStorage storage=stack.pop();
      for (      Area area : storage) {
        if (area.owner == name) {
          return new AreaStoragePair(storage,area);
        }
        stack.add(area.areas);
      }
    }
  }
  return null;
}

Fixed version (ground truth):
public AreaStoragePair playerArea(Player player){
  String name=player.getName().toLowerCase();
  for (  DimensionConfig dim : dimensions) {
    Stack<AreaStorage> stack=new Stack<AreaStorage>();
    stack.add(dim.topAreas);
    while (!stack.isEmpty()) {
      AreaStorage storage=stack.pop();
      for (      Area area : storage) {
        if (area.owner.equals(name)) {
          return new AreaStoragePair(storage,area);
        }
        stack.add(area.areas);
      }
    }
  }
  return null;
}
Program: 151850
Project: 151850
Buggy source:
public DimensionConfig add(Dimension dimension){
  DimensionConfig newDimension=new DimensionConfig();
  newDimension.dimension=dimension;
  newDimension.init();
  dimensions.put(dimension,newDimension);
  return newDimension;
}

Fixed version (ground truth):
public DimensionConfig add(Dimension dimension){
  DimensionConfig newDimension=new DimensionConfig();
  newDimension.dimension=dimension;
  newDimension.init();
  newDimension.finish();
  dimensions.put(dimension,newDimension);
  return newDimension;
}
Program: 151851
Project: 151851
Buggy source:
protected void processBOM() throws IOException {
  byte[] bom=new byte[BOM_SIZE];
  int read=pushbackReader.read(bom,0,BOM_SIZE);
  int unread=0;
  if (read > 0) {
    Set<String> encodings=BOMS.keySet();
    Iterator<String> itr=encodings.iterator();
    while (itr.hasNext()) {
      String currentEncoding=itr.next();
      byte[] currentBOM=BOMS.get(currentEncoding);
      if (arrayStartsWith(bom,currentBOM)) {
        encoding=currentEncoding;
        unread=currentBOM.length;
        break;
      }
    }
    if (unread <= BOM_SIZE && unread > 0) {
      pushbackReader.unread(bom,unread,read - unread);
    }
  }
  if (encoding == null) {
    reader=new InputStreamReader(pushbackReader);
  }
 else {
    reader=new InputStreamReader(pushbackReader,encoding);
  }
}

Fixed version (ground truth):
protected void processBOM() throws IOException {
  byte[] bom=new byte[BOM_SIZE];
  int read=pushbackReader.read(bom,0,BOM_SIZE);
  int unread=0;
  if (read > 0) {
    Set<String> encodings=BOMS.keySet();
    Iterator<String> itr=encodings.iterator();
    while (itr.hasNext()) {
      String currentEncoding=itr.next();
      byte[] currentBOM=BOMS.get(currentEncoding);
      if (arrayStartsWith(bom,currentBOM)) {
        encoding=currentEncoding;
        unread=currentBOM.length;
        break;
      }
    }
    if (unread <= BOM_SIZE) {
      pushbackReader.unread(bom,unread,read - unread);
    }
  }
  if (encoding == null) {
    reader=new InputStreamReader(pushbackReader);
  }
 else {
    reader=new InputStreamReader(pushbackReader,encoding);
  }
}
Program: 151852
Project: 151852
Buggy source:
@Override void setAttribute(String name,String value) throws SAXException {
  if (name.equals(ID)) {
    id=getInt(value);
  }
 else   if (name.equals(NAME)) {
    this.name=value.toLowerCase();
  }
 else   if (name.equals(COLOR)) {
    color=value.charAt(0);
  }
 else   if (name.equals(IGNORE_CHESTS)) {
    ignoreChestLocks=true;
  }
 else   if (name.equals(IGNORE_AREAS)) {
    ignoreAreas=true;
  }
 else   if (name.equals(FORWARD_UNKNOWN)) {
    forwardUnknownCommands=true;
  }
 else   if (name.equals(SHOW_TITLE)) {
    showTitle=true;
  }
 else   if (name.equals(COOLDOWN)) {
    cooldown=getInt(value);
  }
 else   if (name.equals(WARMUP)) {
    warmup=getInt(value);
  }
}

Fixed version (ground truth):
@Override void setAttribute(String name,String value) throws SAXException {
  if (name.equals(ID)) {
    id=getInt(value);
  }
 else   if (name.equals(NAME)) {
    this.name=value;
  }
 else   if (name.equals(COLOR)) {
    color=value.charAt(0);
  }
 else   if (name.equals(IGNORE_CHESTS)) {
    ignoreChestLocks=true;
  }
 else   if (name.equals(IGNORE_AREAS)) {
    ignoreAreas=true;
  }
 else   if (name.equals(FORWARD_UNKNOWN)) {
    forwardUnknownCommands=true;
  }
 else   if (name.equals(SHOW_TITLE)) {
    showTitle=true;
  }
 else   if (name.equals(COOLDOWN)) {
    cooldown=getInt(value);
  }
 else   if (name.equals(WARMUP)) {
    warmup=getInt(value);
  }
}
Program: 151855
Project: 151855
Buggy source:
public static Config load(){
  File file=new File("String_Node_Str","String_Node_Str");
  if (!file.exists()) {
    return null;
  }
  System.out.println("String_Node_Str");
  XMLReader xml;
  try {
    xml=XMLReaderFactory.createXMLReader();
  }
 catch (  SAXException e) {
    e.printStackTrace();
    return null;
  }
  LegacyTagResolver handler;
  try {
    handler=new LegacyTagResolver();
  }
 catch (  SAXException e) {
    e.printStackTrace();
    return null;
  }
  xml.setContentHandler(handler);
  xml.setErrorHandler(handler);
  try {
    xml.setFeature("String_Node_Str",false);
    xml.setEntityResolver(handler);
    xml.parse(new InputSource(new FileReader(file)));
  }
 catch (  FileNotFoundException e) {
    return null;
  }
catch (  Exception e) {
    e.printStackTrace();
    return null;
  }
  return handler.config();
}

Fixed version (ground truth):
public static Config load(){
  File file=new File("String_Node_Str","String_Node_Str");
  if (!file.exists()) {
    return null;
  }
  System.out.println("String_Node_Str");
  XMLReader xml;
  try {
    xml=XMLReaderFactory.createXMLReader();
  }
 catch (  Exception e) {
    e.printStackTrace();
    return null;
  }
  LegacyTagResolver handler;
  try {
    handler=new LegacyTagResolver();
  }
 catch (  Exception e) {
    e.printStackTrace();
    return null;
  }
  xml.setContentHandler(handler);
  xml.setErrorHandler(handler);
  try {
    xml.setFeature("String_Node_Str",false);
    xml.setEntityResolver(handler);
    xml.parse(new InputSource(new FileReader(file)));
  }
 catch (  FileNotFoundException e) {
    e.printStackTrace();
    return null;
  }
catch (  Exception e) {
    e.printStackTrace();
    return null;
  }
  return handler.config();
}
Program: 151856
Project: 151856
Buggy source:
@Override public void load(){
  lock.lock();
  loadsuccess=false;
  InputStream stream;
  if (!getFile().exists()) {
    Config config;
    if ((config=LegacyPermissionConfig.load()) != null) {
      this.config=config;
      return;
    }
 else {
      stream=getClass().getResourceAsStream(filename);
    }
  }
 else {
    try {
      stream=new FileInputStream(getFile());
    }
 catch (    FileNotFoundException e) {
      e.printStackTrace();
      lock.unlock();
      return;
    }
  }
  XMLReader xml;
  try {
    xml=XMLReaderFactory.createXMLReader();
  }
 catch (  SAXException e) {
    e.printStackTrace();
    lock.unlock();
    return;
  }
  XMLTagResolver handler;
  try {
    handler=new XMLTagResolver();
  }
 catch (  SAXException e1) {
    e1.printStackTrace();
    return;
  }
  xml.setContentHandler(handler);
  xml.setErrorHandler(handler);
  try {
    xml.setFeature("String_Node_Str",true);
    xml.setEntityResolver(handler);
    xml.parse(new InputSource(new InputStreamReader(stream)));
  }
 catch (  Exception e) {
    e.printStackTrace();
    lock.unlock();
    return;
  }
  processTags(handler.root());
  loadsuccess=true;
  lock.unlock();
}

Fixed version (ground truth):
@Override public void load(){
  lock.lock();
  loadsuccess=false;
  InputStream stream;
  if (!getFile().exists()) {
    Config config;
    if ((config=LegacyPermissionConfig.load()) != null) {
      this.config=config;
      loadsuccess=true;
      return;
    }
 else {
      stream=getClass().getResourceAsStream(filename);
    }
  }
 else {
    try {
      stream=new FileInputStream(getFile());
    }
 catch (    FileNotFoundException e) {
      e.printStackTrace();
      lock.unlock();
      return;
    }
  }
  XMLReader xml;
  try {
    xml=XMLReaderFactory.createXMLReader();
  }
 catch (  SAXException e) {
    e.printStackTrace();
    lock.unlock();
    return;
  }
  XMLTagResolver handler;
  try {
    handler=new XMLTagResolver();
  }
 catch (  SAXException e1) {
    e1.printStackTrace();
    return;
  }
  xml.setContentHandler(handler);
  xml.setErrorHandler(handler);
  try {
    xml.setFeature("String_Node_Str",true);
    xml.setEntityResolver(handler);
    xml.parse(new InputSource(new InputStreamReader(stream)));
  }
 catch (  Exception e) {
    e.printStackTrace();
    lock.unlock();
    return;
  }
  processTags(handler.root());
  loadsuccess=true;
  lock.unlock();
}
Program: 151857
Project: 151857
Buggy source:
public static Config load(){
  File file=new File("String_Node_Str","String_Node_Str");
  if (!file.exists()) {
    return null;
  }
  XMLReader xml;
  try {
    xml=XMLReaderFactory.createXMLReader();
  }
 catch (  SAXException e) {
    e.printStackTrace();
    return null;
  }
  LegacyTagResolver handler;
  try {
    handler=new LegacyTagResolver();
  }
 catch (  SAXException e) {
    e.printStackTrace();
    return null;
  }
  xml.setContentHandler(handler);
  xml.setErrorHandler(handler);
  try {
    xml.setFeature("String_Node_Str",false);
    xml.setEntityResolver(handler);
    xml.parse(new InputSource(new FileReader(file)));
  }
 catch (  FileNotFoundException e) {
    return null;
  }
catch (  Exception e) {
    e.printStackTrace();
    return null;
  }
  return handler.config();
}

Fixed version (ground truth):
public static Config load(){
  File file=new File("String_Node_Str","String_Node_Str");
  if (!file.exists()) {
    return null;
  }
  System.out.println("String_Node_Str");
  XMLReader xml;
  try {
    xml=XMLReaderFactory.createXMLReader();
  }
 catch (  SAXException e) {
    e.printStackTrace();
    return null;
  }
  LegacyTagResolver handler;
  try {
    handler=new LegacyTagResolver();
  }
 catch (  SAXException e) {
    e.printStackTrace();
    return null;
  }
  xml.setContentHandler(handler);
  xml.setErrorHandler(handler);
  try {
    xml.setFeature("String_Node_Str",false);
    xml.setEntityResolver(handler);
    xml.parse(new InputSource(new FileReader(file)));
  }
 catch (  FileNotFoundException e) {
    return null;
  }
catch (  Exception e) {
    e.printStackTrace();
    return null;
  }
  return handler.config();
}
Program: 151858
Project: 151858
Buggy source:
private void startup(){
  restart=false;
  loadResources();
  if (permissions.loadsuccess == false) {
    System.out.println("String_Node_Str");
    System.exit(1);
  }
  authenticator=new Authenticator(this);
  playerList=new PlayerList(options);
  requestTracker=new RequestTracker(this);
  messager=new Messager(this);
  minecraft=new MinecraftWrapper(this,options,systemInput);
  if (!minecraft.prepareServerJar()) {
    System.out.println("String_Node_Str");
    System.exit(1);
  }
  try {
    minecraft.start();
  }
 catch (  InterruptedException e) {
  }
  if (options.getBoolean("String_Node_Str")) {
    telnetServer=new TelnetServer(this);
  }
  if (options.getBoolean("String_Node_Str")) {
    rconServer=new RconServer(this);
  }
  world=new WorldFile(options.get("String_Node_Str"));
  autoSpaceCheck=new AutoFreeSpaceChecker(this);
  autoBackup=new AutoBackup(this);
  autosave=new AutoSave(this);
  autoRestart=new AutoRestart(this);
  c10t=new AutoRun(this,options.get("String_Node_Str"));
  if (options.contains("String_Node_Str")) {
    try {
      time.freeze(time.parse(options.get("String_Node_Str")));
    }
 catch (    Exception e) {
      System.out.println("String_Node_Str");
    }
  }
  bots.ready();
}

Fixed version (ground truth):
private void startup(){
  restart=false;
  loadResources();
  if (permissions.loadsuccess == false) {
    System.out.println("String_Node_Str");
    System.exit(1);
  }
  authenticator=new Authenticator(this);
  playerList=new PlayerList(options);
  requestTracker=new RequestTracker(this);
  messager=new Messager(this);
  messageLog=new MessageLog(options.get("String_Node_Str"),options.getBoolean("String_Node_Str"));
  minecraft=new MinecraftWrapper(this,options,systemInput);
  if (!minecraft.prepareServerJar()) {
    System.out.println("String_Node_Str");
    System.exit(1);
  }
  try {
    minecraft.start();
  }
 catch (  InterruptedException e) {
  }
  if (options.getBoolean("String_Node_Str")) {
    telnetServer=new TelnetServer(this);
  }
  if (options.getBoolean("String_Node_Str")) {
    rconServer=new RconServer(this);
  }
  world=new WorldFile(options.get("String_Node_Str"));
  autoSpaceCheck=new AutoFreeSpaceChecker(this);
  autoBackup=new AutoBackup(this);
  autosave=new AutoSave(this);
  autoRestart=new AutoRestart(this);
  c10t=new AutoRun(this,options.get("String_Node_Str"));
  if (options.contains("String_Node_Str")) {
    try {
      time.freeze(time.parse(options.get("String_Node_Str")));
    }
 catch (    Exception e) {
      System.out.println("String_Node_Str");
    }
  }
  bots.ready();
}
Program: 151859
Project: 151859
Buggy source:
private void initialize(){
  resources=new LinkedList<Resource>();
  resources.add(permissions=new PermissionConfig(this));
  resources.add(options=new Options());
  resources.add(robots=new RobotList());
  resources.add(motd=new MOTD());
  resources.add(rules=new Rules());
  resources.add(helptext=new HelpText());
  resources.add(kits=new KitList(this));
  resources.add(ipBans=new IPBanList());
  resources.add(whitelist=new WhiteList());
  resources.add(mutelist=new MuteList());
  resources.add(giveAliasList=new GiveAliasList());
  resources.add(data=new GlobalData());
  resources.add(docs=new ReadFiles());
  time=new Time(this);
  bots=new BotController(this);
  systemInput=new SystemInputQueue();
  adminLog=new AdminLog();
  errorLog=new ErrorLog();
  connectionLog=new ConnectionLog();
  messageLog=new MessageLog(options.get("String_Node_Str"),options.getBoolean("String_Node_Str"));
  commandParser=new CommandParser(options,permissions);
}

Fixed version (ground truth):
private void initialize(){
  resources=new LinkedList<Resource>();
  resources.add(permissions=new PermissionConfig(this));
  resources.add(options=new Options());
  resources.add(robots=new RobotList());
  resources.add(motd=new MOTD());
  resources.add(rules=new Rules());
  resources.add(helptext=new HelpText());
  resources.add(kits=new KitList(this));
  resources.add(ipBans=new IPBanList());
  resources.add(whitelist=new WhiteList());
  resources.add(mutelist=new MuteList());
  resources.add(giveAliasList=new GiveAliasList());
  resources.add(data=new GlobalData());
  resources.add(docs=new ReadFiles());
  time=new Time(this);
  bots=new BotController(this);
  systemInput=new SystemInputQueue();
  adminLog=new AdminLog();
  errorLog=new ErrorLog();
  connectionLog=new ConnectionLog();
  commandParser=new CommandParser(options,permissions);
}
Program: 151860
Project: 151860
Buggy source:
private long lastBackupAge(){
  return age(newestBackup());
}

Fixed version (ground truth):
private long lastBackupAge(){
  long age=age(newestBackup());
  return (age >= 0) ? age : Long.MAX_VALUE;
}
Program: 151861
Project: 151861
Buggy source:
private static long age(File file){
  try {
    if (file == null) {
      return 0;
    }
 else {
      return System.currentTimeMillis() - date(file);
    }
  }
 catch (  ParseException e) {
    return System.currentTimeMillis() - file.lastModified();
  }
}

Fixed version (ground truth):
private static long age(File file){
  try {
    if (file == null) {
      return -1;
    }
 else {
      return System.currentTimeMillis() - date(file);
    }
  }
 catch (  ParseException e) {
    return System.currentTimeMillis() - file.lastModified();
  }
}
Program: 151862
Project: 151862
Buggy source:
public boolean allowGuestJoin(){
  return server.options.getBoolean("String_Node_Str");
}

Fixed version (ground truth):
public boolean allowGuestJoin(){
  return server.options.getBoolean("String_Node_Str") || !server.options.getBoolean("String_Node_Str");
}
Program: 151863
Project: 151863
Buggy source:
public String getInvitedPlayer(String prefix){
  for (  String playerName : getPlayersInvited()) {
    if (playerName.startsWith(prefix)) {
      return playerName;
    }
  }
  return prefix;
}

Fixed version (ground truth):
public String getInvitedPlayer(String prefix){
  if (getPlayersInvited().contains(prefix)) {
    return prefix;
  }
  for (  String playerName : getPlayersInvited()) {
    if (playerName.startsWith(prefix)) {
      return playerName;
    }
  }
  return prefix;
}
Program: 151864
Project: 151864
Buggy source:
public void giveLock(Player player,Coordinate coordinate,String name){
  giveLock(player.getName(),coordinate,name);
}

Fixed version (ground truth):
public void giveLock(Player player,Coordinate coordinate,String name){
  giveLock(player.getName().toLowerCase(),coordinate,name);
}
Program: 151865
Project: 151865
Buggy source:
public void teleportSelf(Position position){
  try {
    teleport(position);
  }
 catch (  Exception e) {
    addTMessage(Color.RED,"String_Node_Str");
    return;
  }
  lastTeleport=new Date().getTime();
}

Fixed version (ground truth):
public void teleportSelf(Position position){
  try {
    teleport(position);
  }
 catch (  Exception e) {
    addTMessage(Color.RED,"String_Node_Str");
    return;
  }
  lastTeleport=System.currentTimeMillis();
}
Program: 151866
Project: 151866
Buggy source:
private int cooldownLeft(){
  int cooldown=getGroup().getCooldownMillis();
  if (lastTeleport > new Date().getTime() - cooldown) {
    return (int)(cooldown - new Date().getTime() + lastTeleport);
  }
 else {
    return 0;
  }
}

Fixed version (ground truth):
private int cooldownLeft(){
  int cooldown=getGroup().getCooldownMillis();
  if (lastTeleport > System.currentTimeMillis() - cooldown) {
    return (int)(cooldown - System.currentTimeMillis() + lastTeleport);
  }
 else {
    return 0;
  }
}
Program: 151868
Project: 151868
Buggy source:
public List<String> getHomesPlayerInvitedTo(String playerName){
  List<String> invitedTo=new LinkedList<String>();
  for (  String name : playerData.names()) {
    NBTCompound player=playerData.get(name);
    if (player.containsKey(HOME)) {
      HomePoint home=new HomePoint(player.getCompound(HOME));
      if (home.invites.contains(new NBTString(playerName))) {
        invitedTo.add(name);
      }
    }
  }
  return invitedTo;
}

Fixed version (ground truth):
public List<String> getHomesPlayerInvitedTo(String playerName){
  List<String> invitedHomes=new LinkedList<String>();
  for (  String name : playerData.names()) {
    NBTCompound player=playerData.get(name);
    if (player.containsKey(HOME)) {
      HomePoint home=new HomePoint(player.getCompound(HOME));
      if (home.invites.contains(new NBTString(playerName))) {
        invitedHomes.add(name);
      }
    }
  }
  return invitedHomes;
}
Program: 151869
Project: 151869
Buggy source:
@Override public void save(){
  load();
  options.setProperty("String_Node_Str","String_Node_Str");
  options.setProperty("String_Node_Str","String_Node_Str");
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  super.save();
}

Fixed version (ground truth):
@Override public void save(){
  load();
  options.setProperty("String_Node_Str","String_Node_Str");
  options.setProperty("String_Node_Str","String_Node_Str");
  options.setProperty("String_Node_Str","String_Node_Str");
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  options.setProperty("String_Node_Str",simpleServerOptions.get("String_Node_Str"));
  super.save();
}
Program: 151870
Project: 151870
Buggy source:
@Override public void run(){
  while (run) {
    if (needsBackup()) {
      try {
        server.saveLock.acquire();
      }
 catch (      InterruptedException e) {
        continue;
      }
      forceBackup=false;
      server.autoSpaceCheck.check(true);
      if (server.options.getBoolean("String_Node_Str")) {
        server.runCommand("String_Node_Str",t("String_Node_Str"));
      }
      server.setSaving(true);
      server.runCommand("String_Node_Str",null);
      while (server.isSaving()) {
        try {
          Thread.sleep(100);
        }
 catch (        InterruptedException e) {
        }
      }
      try {
        backup();
      }
 catch (      IOException e) {
        server.errorLog(e,"String_Node_Str");
        System.out.println("String_Node_Str" + e);
        System.out.println("String_Node_Str");
      }
      server.saveLock.release();
      pauseBackup=(server.numPlayers() == 0);
    }
    try {
      Thread.sleep(60000);
    }
 catch (    InterruptedException e) {
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  while (run) {
    if (needsBackup()) {
      try {
        server.saveLock.acquire();
      }
 catch (      InterruptedException e) {
        continue;
      }
      forceBackup=false;
      server.autoSpaceCheck.check(true);
      if (server.options.getBoolean("String_Node_Str")) {
        server.runCommand("String_Node_Str",t("String_Node_Str"));
      }
      server.setSaving(true);
      server.runCommand("String_Node_Str",null);
      while (server.isSaving()) {
        try {
          Thread.sleep(100);
        }
 catch (        InterruptedException e) {
        }
      }
      try {
        backup();
      }
 catch (      IOException e) {
        server.errorLog(e,"String_Node_Str");
        System.out.println("String_Node_Str" + e);
        System.out.println("String_Node_Str");
      }
      server.saveLock.release();
      if (server.numPlayers() == 0) {
        pauseBackup=true;
      }
    }
    if (pauseBackup && server.numPlayers() > 0) {
      pauseBackup=false;
    }
    try {
      Thread.sleep(60000);
    }
 catch (    InterruptedException e) {
    }
  }
}
Program: 151871
Project: 151871
Buggy source:
public void loadResources(){
  for (  Resource resource : resources) {
    resource.load();
  }
  if (playerList != null) {
    playerList.updatePlayerGroups();
  }
  if (!Translations.getInstance().setLanguage(options.get("String_Node_Str"))) {
    options.set("String_Node_Str","String_Node_Str");
    options.save();
  }
  addressFactory.toggle(!options.getBoolean("String_Node_Str"));
  commandParser.reload();
}

Fixed version (ground truth):
public void loadResources(){
  for (  Resource resource : resources) {
    resource.load();
  }
  if (playerList != null) {
    playerList.updatePlayerGroups();
  }
  if (!Translations.getInstance().setLanguage(options.get("String_Node_Str"))) {
    options.set("String_Node_Str","String_Node_Str");
    options.save();
  }
  addressFactory.toggle(!options.getBoolean("String_Node_Str"));
}
Program: 151872
Project: 151872
Buggy source:
public String getHelpText(String prefix){
  if (name != null) {
    return Color.DARK_GREEN + prefix + helpText;
  }
 else {
    return helpText;
  }
}

Fixed version (ground truth):
public String getHelpText(String prefix){
  if (help != null) {
    return Color.DARK_GREEN + prefix + help+ "String_Node_Str"+ Color.WHITE+ t(commandCode);
  }
 else {
    return t(commandCode);
  }
}
Program: 151873
Project: 151873
Buggy source:
protected AbstractCommand(String name,String commandCode){
  if (name != null) {
    helpText=name + Color.WHITE + "String_Node_Str"+ t(commandCode);
    int splitIndex=name.indexOf("String_Node_Str");
    if (splitIndex != -1) {
      name=name.substring(0,splitIndex);
    }
  }
 else {
    helpText=t(commandCode);
  }
  this.name=name;
  this.commandCode=commandCode;
}

Fixed version (ground truth):
protected AbstractCommand(String name,String commandCode){
  help=name;
  if (name != null) {
    int splitIndex=name.indexOf("String_Node_Str");
    if (splitIndex != -1) {
      name=name.substring(0,splitIndex);
    }
  }
  this.name=name;
  this.commandCode=commandCode;
}
Program: 151874
Project: 151874
Buggy source:
public synchronized String getNextAddress(){
  if (!canCycle()) {
    return "String_Node_Str";
  }
  if (octets[2] >= 255) {
    if (octets[1] >= 255) {
      if (octets[0] >= 255) {
        octets[0]=0;
      }
 else {
        ++octets[0];
      }
      octets[1]=0;
    }
 else {
      ++octets[1];
    }
    octets[2]=2;
  }
 else {
    ++octets[2];
  }
  return "String_Node_Str" + octets[0] + "String_Node_Str"+ octets[1]+ "String_Node_Str"+ octets[2];
}

Fixed version (ground truth):
public synchronized String getNextAddress(){
  if (!enabled || !canCycle()) {
    return "String_Node_Str";
  }
  if (octets[2] >= 255) {
    if (octets[1] >= 255) {
      if (octets[0] >= 255) {
        octets[0]=0;
      }
 else {
        ++octets[0];
      }
      octets[1]=0;
    }
 else {
      ++octets[1];
    }
    octets[2]=2;
  }
 else {
    ++octets[2];
  }
  return "String_Node_Str" + octets[0] + "String_Node_Str"+ octets[1]+ "String_Node_Str"+ octets[2];
}
Program: 151875
Project: 151875
Buggy source:
private void toggle(boolean enabled){
  canCycle=enabled ? null : false;
}

Fixed version (ground truth):
private void toggle(boolean enabled){
  LocalAddressFactory.enabled=enabled;
}
Program: 151876
Project: 151876
Buggy source:
public void close(){
  if (serverToClient != null) {
    serverToClient.stop();
  }
  if (clientToServer != null) {
    clientToServer.stop();
  }
  if (name != null) {
    server.authenticator.unbanLogin(this);
    if (usedAuthenticator) {
      if (guest) {
        server.authenticator.releaseGuestName(name);
      }
 else {
        server.authenticator.rememberAuthentication(name,getIPAddress());
      }
    }
 else     if (guest) {
      server.authenticator.rememberGuest(name,getIPAddress());
    }
    server.data.players.stats.add(this,StatField.PLAY_TIME,(int)(System.currentTimeMillis() - connected) / 1000 / 60);
    server.data.players.stats.add(this,StatField.BLOCKS_DESTROYED,blocksDestroyed);
    server.data.players.stats.add(this,StatField.BLOCKS_PLACED,blocksPlaced);
    server.data.save();
    server.playerList.removePlayer(this);
    name=null;
  }
}

Fixed version (ground truth):
public void close(){
  if (serverToClient != null) {
    serverToClient.stop();
  }
  if (clientToServer != null) {
    clientToServer.stop();
  }
  if (name != null) {
    server.authenticator.unbanLogin(this);
    if (usedAuthenticator) {
      if (guest) {
        server.authenticator.releaseGuestName(name);
      }
 else {
        server.authenticator.rememberAuthentication(name,getIPAddress());
      }
    }
 else     if (guest) {
      if (isKicked) {
        server.authenticator.releaseGuestName(name);
      }
 else {
        server.authenticator.rememberGuest(name,getIPAddress());
      }
    }
    server.data.players.stats.add(this,StatField.PLAY_TIME,(int)(System.currentTimeMillis() - connected) / 1000 / 60);
    server.data.players.stats.add(this,StatField.BLOCKS_DESTROYED,blocksDestroyed);
    server.data.players.stats.add(this,StatField.BLOCKS_PLACED,blocksPlaced);
    server.data.save();
    server.playerList.removePlayer(this);
    name=null;
  }
}
Program: 151879
Project: 151879
Buggy source:
public void execute(Player player,String message){
  String name=extractArgument(message);
  if (name == null) {
    if (player.isAttemptLock()) {
      player.setAttemptedAction(null);
      player.addTMessage(Color.GRAY,"String_Node_Str");
      return;
    }
 else {
      name="String_Node_Str";
    }
  }
  if (name.equals("String_Node_Str")) {
    Map<String,Integer> list=player.getServer().data.chests.chestList(player);
    if (list.size() == 0) {
      player.addTMessage(Color.GRAY,"String_Node_Str");
    }
 else {
      player.addTMessage(Color.GRAY,"String_Node_Str");
      for (      String current : list.keySet()) {
        player.addMessage(Color.GRAY,list.get(current) + "String_Node_Str" + current);
      }
    }
  }
 else {
    player.addTMessage(Color.GRAY,"String_Node_Str");
    player.setAttemptedAction(Action.Lock);
    player.setChestName(name);
  }
}

Fixed version (ground truth):
public void execute(Player player,String message){
  String name=extractArgument(message);
  if (name == null) {
    if (player.isAttemptLock()) {
      player.setAttemptedAction(null);
      player.addTMessage(Color.GRAY,"String_Node_Str");
      return;
    }
  }
  if (name != null && name.equals("String_Node_Str")) {
    Map<String,Integer> list=player.getServer().data.chests.chestList(player);
    if (list.size() == 0) {
      player.addTMessage(Color.GRAY,"String_Node_Str");
    }
 else {
      player.addTMessage(Color.GRAY,"String_Node_Str");
      for (      String current : list.keySet()) {
        player.addMessage(Color.GRAY,list.get(current) + "String_Node_Str" + current);
      }
    }
  }
 else {
    player.addTMessage(Color.GRAY,"String_Node_Str");
    player.setAttemptedAction(Action.Lock);
    player.setChestName(name);
  }
}
Program: 151880
Project: 151880
Buggy source:
@Override public void load(){
  boolean success=false;
  File inFile=getFile();
  try {
    BufferedReader reader=new BufferedReader(new FileReader(inFile));
    try {
      String line;
      while ((line=reader.readLine()) != null) {
        if (!line.startsWith("String_Node_Str")) {
          loadLine(line);
        }
      }
      success=true;
    }
  finally {
      reader.close();
    }
  }
 catch (  FileNotFoundException e) {
    System.out.println(getFilename() + "String_Node_Str");
    loadDefaults();
    save();
    success=true;
  }
catch (  IOException e) {
    e.printStackTrace();
  }
  if (!success) {
    System.out.println("String_Node_Str" + getFilename() + "String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void load(){
  boolean success=false;
  File inFile=getFile();
  try {
    BufferedReader reader=new BufferedReader(new FileReader(inFile));
    try {
      String line;
      while ((line=reader.readLine()) != null) {
        if (!line.startsWith("String_Node_Str")) {
          loadLine(line);
        }
      }
      success=true;
    }
  finally {
      reader.close();
    }
  }
 catch (  FileNotFoundException e) {
    missingFile();
    loadDefaults();
    save();
    success=true;
  }
catch (  IOException e) {
    e.printStackTrace();
  }
  if (!success) {
    System.out.println("String_Node_Str" + getFilename() + "String_Node_Str");
  }
}