nus-yam/ex-repair huggingface dataset:
Program: 150315
Project: 150315
Buggy source:
private BigDecimal createBalanceCache(Journal journal,Account acct,short[] layers,long maxId) throws HibernateException, GLException {
  BigDecimal balance=null;
  if (acct instanceof CompositeAccount) {
    balance=ZERO;
    Iterator iter=((CompositeAccount)acct).getChildren().iterator();
    while (iter.hasNext()) {
      Account a=(Account)iter.next();
      balance=balance.add(createBalanceCache(journal,a,layers,maxId));
    }
  }
 else   if (acct instanceof FinalAccount) {
    lock(journal,acct);
    balance=getBalances(journal,acct,null,true,layers,maxId)[0];
    BalanceCache c=getBalanceCache(journal,acct,layers);
    if (c == null) {
      c=new BalanceCache();
      c.setJournal(journal);
      c.setAccount(acct);
      c.setLayers(layersToString(layers));
    }
    if (maxId != c.getRef()) {
      c.setRef(maxId);
      c.setBalance(balance);
      session.saveOrUpdate(c);
    }
  }
  return balance;
}

Fixed version (ground truth):
private BigDecimal createBalanceCache(Journal journal,Account acct,short[] layers,long maxId) throws HibernateException, GLException {
  BigDecimal balance=null;
  if (acct instanceof CompositeAccount) {
    balance=ZERO;
    Iterator iter=((CompositeAccount)acct).getChildren().iterator();
    while (iter.hasNext()) {
      Account a=(Account)iter.next();
      balance=balance.add(createBalanceCache(journal,a,layers,maxId));
    }
  }
 else   if (acct instanceof FinalAccount) {
    lock(journal,acct);
    balance=getBalances(journal,acct,null,true,layers,maxId)[0];
    BalanceCache c=getBalanceCache(journal,acct,layers);
    if (c == null) {
      c=new BalanceCache();
      c.setJournal(journal);
      c.setAccount(acct);
      c.setLayers(layersToString(layers));
    }
    if (maxId != c.getRef()) {
      c.setRef(maxId);
      c.setBalance(balance);
      session.saveOrUpdate(c);
    }
  }
  return getBalance(journal,acct,layers);
}
Program: 150316
Project: 150316
Buggy source:
/** 
 * Creates DB Object using default Hibernate instance
 * @param log Log object
 */
public DB(Log log,String configModifier){
  this(configModifier);
  setLog(log);
}

Fixed version (ground truth):
/** 
 * Creates DB Object using default Hibernate instance
 * @param log Log object
 * @param configModifier modifier
 */
public DB(Log log,String configModifier){
  this(configModifier);
  setLog(log);
}
Program: 150317
Project: 150317
Buggy source:
/** 
 * Constructs a GLTransaction out of a JDOM Element as defined in <a href="http://jpos.org/minigl.dtd">minigl.dtd</a>
 * @param elem '<entry>...</entry>' element.
 */
public GLTransaction(Element elem) throws ParseException {
  super();
  fromXML(elem);
}

Fixed version (ground truth):
/** 
 * Constructs a GLTransaction out of a JDOM Element as defined in <a href="http://jpos.org/minigl.dtd">minigl.dtd</a>
 * @param elem {@code '<entry>...</entry>}' element.
 */
public GLTransaction(Element elem) throws ParseException {
  super();
  fromXML(elem);
}
Program: 150318
Project: 150318
Buggy source:
/** 
 * Transactions should not be posted to this journal using a postDate <= the lockDate.
 * @lockDate lockDate the lock date.
 */
public void setLockDate(Date lockDate){
  this.lockDate=lockDate;
}

Fixed version (ground truth):
/** 
 * Transactions should not be posted to this journal using a postDate &lt;= the lockDate.
 * @param lockDate the lock date.
 */
public void setLockDate(Date lockDate){
  this.lockDate=lockDate;
}
Program: 150319
Project: 150319
Buggy source:
/** 
 * Called <em>after</em> the FLUSH protocol has unblocked previously blocked senders, and messages can be sent again. This callback only needs to be implemented if we require a notification of that. <p/> <p/> Note that during new view installation we provide guarantee that unblock invocation strictly follows view installation at some node A belonging to that view . However, some other message M may squeeze in between view and unblock callbacks. <p/> For more details see https://jira.jboss.org/jira/browse/JGRP-986
 */
@Override public void unblock(){
}

Fixed version (ground truth):
/** 
 * Called <em>after</em> the FLUSH protocol has unblocked previously blocked senders, and messages can be sent again. This callback only needs to be implemented if we require a notification of that. <p> Note that during new view installation we provide guarantee that unblock invocation strictly follows view installation at some node A belonging to that view . However, some other message M may squeeze in between view and unblock callbacks. <p> For more details see https://jira.jboss.org/jira/browse/JGRP-986
 */
@Override public void unblock(){
}
Program: 150320
Project: 150320
Buggy source:
/** 
 * Computes expiration based on last tick + timeout
 * @return true if lasttick+timeout < current-time
 */
public boolean hasExpired(){
  long now=System.currentTimeMillis();
  Date lastTick=getLastTick();
  long timeout=getTimeout();
  if (lastTick == null || timeout == 0)   return false;
  long exp=lastTick.getTime() + timeout;
  return now > exp;
}

Fixed version (ground truth):
/** 
 * Computes expiration based on last tick + timeout
 * @return true if lasttick+timeout &lt; current-time
 */
public boolean hasExpired(){
  long now=System.currentTimeMillis();
  Date lastTick=getLastTick();
  long timeout=getTimeout();
  if (lastTick == null || timeout == 0)   return false;
  long exp=lastTick.getTime() + timeout;
  return now > exp;
}
Program: 150321
Project: 150321
Buggy source:
/** 
 * factory method used to create a RevisionEntry associated with this user.
 * @param summary information
 * @param detail detailed information
 * @param author change author
 */
public StatusRevision logRevision(String info,User author){
  StatusRevision re=new StatusRevision();
  re.setDate(new Date());
  re.setInfo(info);
  re.setStatus((Status)this);
  re.setAuthor(author);
  getRevisions().add(re);
  return re;
}

Fixed version (ground truth):
/** 
 * factory method used to create a RevisionEntry associated with this user.
 * @param info information<!-- @param detail detailed information -->
 * @param author change author
 */
public StatusRevision logRevision(String info,User author){
  StatusRevision re=new StatusRevision();
  re.setDate(new Date());
  re.setInfo(info);
  re.setStatus((Status)this);
  re.setAuthor(author);
  getRevisions().add(re);
  return re;
}
Program: 150322
Project: 150322
Buggy source:
/** 
 * @param key status name
 * @param state Status.OK, Status.WARN, Status.ERROR or user defined
 * @param info optional information
 */
public void touch(String key,String state) throws HibernateException, SQLException {
  touch(key,state,null);
}

Fixed version (ground truth):
/** 
 * @param key status name
 * @param state Status.OK, Status.WARN, Status.ERROR or user defined<!-- @param info optional information -->
 */
public void touch(String key,String state) throws HibernateException, SQLException {
  touch(key,state,null);
}
Program: 150323
Project: 150323
Buggy source:
/** 
 * check if unexpired status entries became expired, and create  appropriate syslog event.
 * @param id status id
 */
public void check() throws HibernateException, SQLException {
  Iterator iter=findByExpired(false).iterator();
  while (iter.hasNext()) {
    check((Status)iter.next());
  }
}

Fixed version (ground truth):
/** 
 * check if unexpired status entries became expired, and create  appropriate syslog event.
 */
public void check() throws HibernateException, SQLException {
  Iterator iter=findByExpired(false).iterator();
  while (iter.hasNext()) {
    check((Status)iter.next());
  }
}
Program: 150324
Project: 150324
Buggy source:
/** 
 * Hook method to let a subclass change the way the values are compared
 * @param i index of the property being compared in de ordergiven by the <code>properties<code> attribute.
 */
protected boolean equals(int i,Object v1,Object v2){
  if (v1 instanceof Comparable && v2 != null)   return ((Comparable)v1).compareTo(v2) == 0;
 else   if (v1 != null)   return v1.equals(v2);
 else   return v2 == null;
}

Fixed version (ground truth):
/** 
 * Hook method to let a subclass change the way the values are compared
 * @param i index of the property being compared in de ordergiven by the <code>properties</code> attribute.
 */
protected boolean equals(int i,Object v1,Object v2){
  if (v1 instanceof Comparable && v2 != null)   return ((Comparable)v1).compareTo(v2) == 0;
 else   if (v1 != null)   return v1.equals(v2);
 else   return v2 == null;
}
Program: 150325
Project: 150325
Buggy source:
/** 
 * Creates a JDOM Element as defined in <a href="http://jpos.org/minigl.dtd">minigl.dtd</a>
 */
public Element toXML(boolean deep){
  Element elem=new Element("String_Node_Str");
  elem.setAttribute("String_Node_Str",Long.toString(getId()));
  Util.setDateTimeAttribute(elem,"String_Node_Str",getTimestamp());
  Util.setDateAttribute(elem,"String_Node_Str",getPostDate());
  if (getDetail() != null) {
    Element detail=new Element("String_Node_Str").setText(getDetail());
    elem.addContent(detail);
  }
  if (getTags() != null) {
    Element tags=new Element("String_Node_Str").setText(getDetail());
    elem.addContent(tags);
  }
  elem.setAttribute("String_Node_Str",getJournal().getName());
  Iterator iter=getEntries().iterator();
  while (iter.hasNext()) {
    GLEntry entry=(GLEntry)iter.next();
    elem.addContent(entry.toXML(deep));
  }
  return elem;
}

Fixed version (ground truth):
/** 
 * Creates a JDOM Element as defined in <a href="http://jpos.org/minigl.dtd">minigl.dtd</a>
 */
public Element toXML(boolean deep){
  Element elem=new Element("String_Node_Str");
  elem.setAttribute("String_Node_Str",Long.toString(getId()));
  Util.setDateTimeAttribute(elem,"String_Node_Str",getTimestamp());
  Util.setDateAttribute(elem,"String_Node_Str",getPostDate());
  if (getDetail() != null) {
    Element detail=new Element("String_Node_Str").setText(getDetail());
    elem.addContent(detail);
  }
  if (getTags() != null) {
    Element tags=new Element("String_Node_Str").setText(getTags());
    elem.addContent(tags);
  }
  elem.setAttribute("String_Node_Str",getJournal().getName());
  Iterator iter=getEntries().iterator();
  while (iter.hasNext()) {
    GLEntry entry=(GLEntry)iter.next();
    elem.addContent(entry.toXML(deep));
  }
  return elem;
}
Program: 150326
Project: 150326
Buggy source:
public String toString(){
  return new ToStringBuilder(this).append("String_Node_Str",getId()).append("String_Node_Str",getId()).toString();
}

Fixed version (ground truth):
public String toString(){
  return new ToStringBuilder(this).append("String_Node_Str",getId()).append("String_Node_Str",getDetail()).toString();
}
Program: 150327
Project: 150327
Buggy source:
@Override public void start(final Environment env) throws IOException {
  TtyFilterOutputStream out=new TtyFilterOutputStream(this.out);
  TtyFilterOutputStream err=new TtyFilterOutputStream(this.err);
  final Groovysh shell=new Groovysh(createBinding(bindings,out,err),new IO(in,out,err));
  loadDefaultScripts(shell);
  String threadName="String_Node_Str";
  wrapper=new Thread(new Runnable(){
    @Override public void run(){
      try {
        SshTerminal.registerEnvironment(env);
        shell.run();
        callback.onExit(0);
      }
 catch (      RuntimeException e) {
        callback.onExit(-1,e.getMessage());
      }
catch (      Error e) {
        callback.onExit(-1,e.getMessage());
      }
    }
  }
,threadName);
  wrapper.start();
}

Fixed version (ground truth):
@Override public void start(final Environment env) throws IOException {
  TtyFilterOutputStream out=new TtyFilterOutputStream(this.out);
  TtyFilterOutputStream err=new TtyFilterOutputStream(this.err);
  final Groovysh shell=new Groovysh(createBinding(bindings,out,err),new IO(in,out,err));
  try {
    loadDefaultScripts(shell);
  }
 catch (  Exception e) {
    createPrintStream(err).println("String_Node_Str" + e.getClass().getName() + "String_Node_Str"+ e.getMessage());
  }
  String threadName="String_Node_Str";
  wrapper=new Thread(new Runnable(){
    @Override public void run(){
      try {
        SshTerminal.registerEnvironment(env);
        shell.run();
        callback.onExit(0);
      }
 catch (      RuntimeException e) {
        callback.onExit(-1,e.getMessage());
      }
catch (      Error e) {
        callback.onExit(-1,e.getMessage());
      }
    }
  }
,threadName);
  wrapper.start();
}
Program: 150328
Project: 150328
Buggy source:
private Binding createBinding(Map<String,Object> objects,OutputStream out,OutputStream err) throws UnsupportedEncodingException {
  Binding binding=new Binding();
  if (objects != null)   for (  Map.Entry<String,Object> row : objects.entrySet())   binding.setVariable(row.getKey(),row.getValue());
  binding.setVariable("String_Node_Str",new PrintStream(out,true,"String_Node_Str"));
  binding.setVariable("String_Node_Str",new PrintStream(err,true,"String_Node_Str"));
  binding.setVariable("String_Node_Str",new Closure<List<AbstractSession>>(this){
    @Override public List<AbstractSession> call(){
      return sshd.getActiveSessions();
    }
  }
);
  return binding;
}

Fixed version (ground truth):
private Binding createBinding(Map<String,Object> objects,OutputStream out,OutputStream err) throws UnsupportedEncodingException {
  Binding binding=new Binding();
  if (objects != null)   for (  Map.Entry<String,Object> row : objects.entrySet())   binding.setVariable(row.getKey(),row.getValue());
  binding.setVariable("String_Node_Str",createPrintStream(out));
  binding.setVariable("String_Node_Str",createPrintStream(err));
  binding.setVariable("String_Node_Str",new Closure<List<AbstractSession>>(this){
    @Override public List<AbstractSession> call(){
      return sshd.getActiveSessions();
    }
  }
);
  return binding;
}
Program: 150329
Project: 150329
Buggy source:
/** 
 * Set the comma delimited list of default scripts
 * @param scriptNames script names
 */
public void setDefaultScriptNames(String scriptNames){
  service.setDefaultScripts(asList(scriptNames.split("String_Node_Str")));
}

Fixed version (ground truth):
/** 
 * Set the comma delimited list of default scripts
 * @param scriptNames script names
 */
public void setDefaultScriptNames(String scriptNames){
  if (!scriptNames.trim().isEmpty())   service.setDefaultScripts(asList(scriptNames.split("String_Node_Str")));
}
Program: 150330
Project: 150330
Buggy source:
@Override public void start(final Environment env) throws IOException {
  TtyFilterOutputStream out=new TtyFilterOutputStream(this.out);
  TtyFilterOutputStream err=new TtyFilterOutputStream(this.err);
  final Groovysh shell=new Groovysh(createBinding(bindings,out,err),new IO(in,out,err));
  try {
    loadDefaultScripts(shell);
  }
 catch (  Exception e) {
    createPrintStream(err).println("String_Node_Str" + e.getClass().getName() + "String_Node_Str"+ e.getMessage());
  }
  String threadName="String_Node_Str";
  wrapper=new Thread(new Runnable(){
    @Override public void run(){
      try {
        SshTerminal.registerEnvironment(env);
        shell.run();
        callback.onExit(0);
      }
 catch (      RuntimeException e) {
        callback.onExit(-1,e.getMessage());
      }
catch (      Error e) {
        callback.onExit(-1,e.getMessage());
      }
    }
  }
,threadName);
  wrapper.start();
}

Fixed version (ground truth):
@Override public void start(final Environment env) throws IOException {
  TtyFilterOutputStream out=new TtyFilterOutputStream(this.out);
  TtyFilterOutputStream err=new TtyFilterOutputStream(this.err);
  IO io=new IO(in,out,err);
  io.setVerbosity(IO.Verbosity.DEBUG);
  final Groovysh shell=new Groovysh(createBinding(bindings,out,err),io);
  shell.setErrorHook(new Closure(this){
    @Override public Object call(    Object... args){
      if (args[0] instanceof InterruptedIOException || args[0] instanceof SshException) {
        shell.getRunner().setRunning(false);
      }
      return shell.getDefaultErrorHook().call(args);
    }
  }
);
  try {
    loadDefaultScripts(shell);
  }
 catch (  Exception e) {
    createPrintStream(err).println("String_Node_Str" + e.getClass().getName() + "String_Node_Str"+ e.getMessage());
  }
  session.setAttribute(SHELL_KEY,shell);
  String threadName="String_Node_Str" + session.getIoSession().getRemoteAddress().toString();
  wrapper=new Thread(new Runnable(){
    @Override public void run(){
      try {
        SshTerminal.registerEnvironment(env);
        shell.run();
        callback.onExit(0);
      }
 catch (      RuntimeException e) {
        callback.onExit(-1,e.getMessage());
      }
catch (      Error e) {
        callback.onExit(-1,e.getMessage());
      }
    }
  }
,threadName);
  wrapper.start();
}
Program: 150331
Project: 150331
Buggy source:
/** 
 * Starts Groovysh
 * @throws IOException thrown if socket cannot be opened
 */
public synchronized void start() throws IOException {
  sshd=SshServer.setUpDefaultServer();
  sshd.setPort(port);
  sshd.setKeyPairProvider(new SimpleGeneratorHostKeyProvider("String_Node_Str"));
  NamedFactory<UserAuth> a=new UserAuthNone.Factory();
  sshd.setUserAuthFactories(asList(a));
  sshd.setShellFactory(new GroovyShellFactory());
  sshd.start();
}

Fixed version (ground truth):
/** 
 * Starts Groovysh
 * @throws IOException thrown if socket cannot be opened
 */
public synchronized void start() throws IOException {
  sshd=SshServer.setUpDefaultServer();
  sshd.setPort(port);
  Map<String,String> properties=new HashMap<String,String>();
  properties.put(ServerFactoryManager.IDLE_TIMEOUT,"String_Node_Str");
  sshd.setProperties(properties);
  SessionFactory sessionFactory=new SessionFactory();
  sessionFactory.addListener(new SessionListener(){
    @Override public void sessionCreated(    Session session){
    }
    @Override public void sessionEvent(    Session sesssion,    Event event){
    }
    @Override public void sessionClosed(    Session session){
      Groovysh shell=session.getAttribute(SHELL_KEY);
      if (shell != null)       shell.getRunner().setRunning(false);
    }
  }
);
  sshd.setSessionFactory(sessionFactory);
  sshd.setKeyPairProvider(new SimpleGeneratorHostKeyProvider("String_Node_Str"));
  NamedFactory<UserAuth> a=new UserAuthNone.Factory();
  sshd.setUserAuthFactories(asList(a));
  sshd.setShellFactory(new GroovyShellFactory());
  sshd.start();
}
Program: 150332
Project: 150332
Buggy source:
@Override protected void executeWithTarget(Server server,String message,String target,CommandFeedback feedback){
  mute(server,name);
  server.adminLog("String_Node_Str" + name);
  feedback.send("String_Node_Str",target);
}

Fixed version (ground truth):
@Override protected void executeWithTarget(Server server,String message,String target,CommandFeedback feedback){
  unmute(server,target);
  server.adminLog("String_Node_Str" + target);
  feedback.send("String_Node_Str",target);
}
Program: 150334
Project: 150334
Buggy source:
@Override void setAttribute(String name,String value) throws SAXException {
  if (name.equals("String_Node_Str")) {
    allow=new Permission(value);
  }
 else   if (name.equals("String_Node_Str")) {
    argument=value;
  }
}

Fixed version (ground truth):
@Override void setAttribute(String name,String value) throws SAXException {
  if (name.equals("String_Node_Str")) {
    allow=new Permission(value);
  }
 else   if (name.equals("String_Node_Str")) {
    content(value);
  }
}
Program: 150336
Project: 150336
Buggy source:
private void respawn() throws IOException {
  writeLock.lock();
  out.writeByte(9);
  out.writeByte(position.dimension.index());
  out.writeByte(0);
  out.writeShort(128);
  out.writeLong(0);
  writeLock.unlock();
}

Fixed version (ground truth):
private void respawn() throws IOException {
  writeLock.lock();
  out.writeByte(9);
  out.writeByte(position.dimension.index());
  out.writeByte(0);
  out.writeShort(128);
  out.writeLong(0);
  write(readUTF16());
  writeLock.unlock();
}
Program: 150338
Project: 150338
Buggy source:
protected void login() throws IOException {
  writeLock.lock();
  out.writeByte(1);
  out.writeInt(VERSION);
  write(name);
  out.writeLong(0);
  out.writeInt(0);
  out.writeByte(0);
  out.writeByte(0);
  out.writeByte(0);
  out.writeByte(0);
  writeLock.unlock();
}

Fixed version (ground truth):
protected void login() throws IOException {
  writeLock.lock();
  out.writeByte(1);
  out.writeInt(VERSION);
  write(name);
  out.writeLong(0);
  write(readUTF16());
  out.writeInt(0);
  out.writeByte(0);
  out.writeByte(0);
  out.writeByte(0);
  out.writeByte(0);
  writeLock.unlock();
}
Program: 150339
Project: 150339
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","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","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","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","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"));
  options.setProperty("String_Node_Str","String_Node_Str");
  super.save();
}
Program: 150340
Project: 150340
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();
  finish();
}

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();
  super.finish();
}
Program: 150341
Project: 150341
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;
    }
  }
  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);
  }
}

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 {
    if (name != null && name.length() > 16) {
      player.addTMessage(Color.RED,"String_Node_Str");
      return;
    }
    player.addTMessage(Color.GRAY,"String_Node_Str");
    player.setAttemptedAction(Action.Lock);
    player.setChestName(name);
  }
}
Program: 150343
Project: 150343
Buggy source:
public void add(Area area){
  topAreas.add(area);
  areas.add(area);
}

Fixed version (ground truth):
public void add(Area area){
  topAreas.add(area);
}
Program: 150345
Project: 150345
Buggy source:
public boolean setName(String name){
  renameName=server.data.players.getRenameName(name);
  name=name.trim();
  if (name.length() == 0 || this.name != null) {
    kick(t("String_Node_Str"));
    return false;
  }
  if (name == "String_Node_Str") {
    kick(t("String_Node_Str"));
    return false;
  }
  if (!guest && server.options.getBoolean("String_Node_Str") && !server.whitelist.isWhitelisted(name)) {
    kick(t("String_Node_Str"));
    return false;
  }
  if (server.playerList.findPlayerExact(name) != null) {
    kick(t("String_Node_Str"));
    return false;
  }
  this.name=name;
  updateGroup();
  watchdog.setName("String_Node_Str" + name);
  server.connectionLog("String_Node_Str",extsocket,name);
  if (server.numPlayers() == 0) {
    server.time.set();
  }
  server.playerList.addPlayer(this);
  return true;
}

Fixed version (ground truth):
public boolean setName(String name){
  renameName=server.data.players.getRenameName(name);
  name=name.trim();
  if (name.length() == 0 || this.name != null) {
    kick(t("String_Node_Str"));
    return false;
  }
  if (name == "String_Node_Str") {
    kick(t("String_Node_Str"));
    return false;
  }
  if (!guest && server.options.getBoolean("String_Node_Str") && !server.whitelist.isWhitelisted(name)) {
    kick(t("String_Node_Str"));
    return false;
  }
  if (server.playerList.findPlayerExact(name) != null) {
    kick(t("String_Node_Str"));
    return false;
  }
  this.name=name;
  updateGroup();
  addMessage(Integer.toString(group));
  watchdog.setName("String_Node_Str" + name);
  server.connectionLog("String_Node_Str",extsocket,name);
  if (server.numPlayers() == 0) {
    server.time.set();
  }
  server.playerList.addPlayer(this);
  return true;
}
Program: 150346
Project: 150346
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(0,str.length() - 2);
  }
  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();
  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());
}
Program: 150348
Project: 150348
Buggy source:
private boolean areaSizeOk(Player player){
  return (Math.abs(player.areastart.x() - player.areaend.x()) <= 50) && (Math.abs(player.areastart.y() - player.areaend.y()) <= 50) && player.areaend.dimension() == player.areastart.dimension();
}

Fixed version (ground truth):
private boolean areaSizeOk(Player player){
  return (Math.abs(player.areastart.x() - player.areaend.x()) < 50) && (Math.abs(player.areastart.z() - player.areaend.z()) < 50) && player.areaend.dimension() == player.areastart.dimension();
}
Program: 150350
Project: 150350
Buggy source:
protected AbstractConfig(String filename){
  this.filename=filename;
}

Fixed version (ground truth):
protected AbstractConfig(String filename){
  this.filename=filename;
  loadHeader();
}
Program: 150351
Project: 150351
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;
}

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();
}
Program: 150352
Project: 150352
Buggy source:
@Override void setAttribute(String name,String value) throws SAXException {
  if (name.equals(NAME)) {
    this.name=value;
  }
 else   if (name.equals(START)) {
    start=getCoord(value,0);
  }
 else   if (name.equals(END)) {
    end=getCoord(value,128);
  }
 else   if (name.equals(OWNER)) {
    owner=value;
  }
 else   if (name.equals(PRIORITY)) {
    priority=getInt(value);
  }
}

Fixed version (ground truth):
@Override void setAttribute(String name,String value) throws SAXException {
  if (name.equals(NAME)) {
    this.name=value;
  }
 else   if (name.equals(START)) {
    start=getCoord(value,0);
  }
 else   if (name.equals(END)) {
    end=getCoord(value,127);
  }
 else   if (name.equals(OWNER)) {
    owner=value;
  }
 else   if (name.equals(PRIORITY)) {
    priority=getInt(value);
  }
}
Program: 150353
Project: 150353
Buggy source:
Permission permission(String args){
  for (  Argument arg : arguments) {
    if (args.startsWith(arg.argument)) {
      return arg.allow;
    }
  }
  return null;
}

Fixed version (ground truth):
Permission permission(String args){
  if (arguments == null) {
    return null;
  }
  for (  Argument arg : arguments) {
    if (args.startsWith(arg.argument)) {
      return arg.allow;
    }
  }
  return null;
}
Program: 150354
Project: 150354
Buggy source:
public CommandConfig getTopConfig(String name){
  if (commands.containsKey(name)) {
    return commands.get(name);
  }
  for (  CommandConfig command : commands.values()) {
    if (command.aliases.contains(name)) {
      return command;
    }
  }
  return null;
}

Fixed version (ground truth):
public CommandConfig getTopConfig(String name){
  if (commands.containsKey(name)) {
    return commands.get(name);
  }
  for (  CommandConfig command : commands.values()) {
    if (command.alias(name)) {
      return command;
    }
  }
  return null;
}
Program: 150355
Project: 150355
Buggy source:
public Iterator<CommandConfig> iterator(){
  return commands.values().iterator();
}

Fixed version (ground truth):
@Override public Iterator<CommandConfig> iterator(){
  return commands.values().iterator();
}
Program: 150356
Project: 150356
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: 150357
Project: 150357
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: 150358
Project: 150358
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: 150359
Project: 150359
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: 150360
Project: 150360
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: 150361
Project: 150361
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: 150362
Project: 150362
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: 150363
Project: 150363
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: 150364
Project: 150364
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: 150365
Project: 150365
Buggy source:
@Override public void finish(){
  DimensionAreaStorage.getInstance().decreaseLevel();
}

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

Fixed version (ground truth):
public Chests(Permission permission){
  this();
  allow=permission;
}
Program: 150367
Project: 150367
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: 150368
Project: 150368
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: 150369
Project: 150369
Buggy source:
void decreaseLevel(){
  positions.pop();
}

Fixed version (ground truth):
void decreaseLevel(){
  if (positions != null && !positions.isEmpty()) {
    positions.pop();
  }
}
Program: 150370
Project: 150370
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: 150371
Project: 150371
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: 150373
Project: 150373
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: 150374
Project: 150374
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: 150375
Project: 150375
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();
}