nus-yam/ex-repair huggingface dataset:
Program: 84880
Project: 84880
Buggy source:
public void cleanWorldInventories(){
  for (  String inventory : inventories.keySet()) {
    convertFormat(inventory);
    deleteIfUnused(inventory);
  }
  serialize();
  return;
}

Fixed version (ground truth):
public void cleanWorldInventories(){
  for (  String inventory : inventories.keySet()) {
    deleteIfUnused(convertFormat(inventory));
  }
  serialize();
  return;
}
Program: 84881
Project: 84881
Buggy source:
private int shareCheck(String world1,String world2){
  if (plugin.sharedNames.contains(world1)) {
    if (plugin.sharedNames.contains(world2)) {
      if (plugin.sharedWorlds.containsKey(plugin.getServer().getWorld(world1))) {
        for (        World world : plugin.sharedWorlds.get(plugin.getServer().getWorld(world1))) {
          if (world.getName().equals(world2)) {
            return 4;
          }
        }
      }
      if (plugin.sharedWorlds.containsKey(plugin.getServer().getWorld(world2))) {
        for (        World world : plugin.sharedWorlds.get(plugin.getServer().getWorld(world2))) {
          if (world.getName().equals(world1)) {
            return 4;
          }
        }
      }
      return 3;
    }
    return 1;
  }
  if (plugin.sharedNames.contains(world2)) {
    return 2;
  }
  return 0;
}

Fixed version (ground truth):
private int shareCheck(String world1,String world2){
  if (plugin.sharesMap.containsKey(world1)) {
    if (plugin.sharesMap.containsKey(world2)) {
      return 3;
    }
    return 1;
  }
  if (plugin.sharesMap.containsKey(world2)) {
    return 2;
  }
  return 0;
}
Program: 84882
Project: 84882
Buggy source:
public void storeWorldInventory(Player player,String world){
  if (plugin.sharesMap.contains(world)) {
    world=plugin.sharesMap.get(world);
  }
  String inventoryName=player.getName() + "String_Node_Str" + world;
  MultiInvPlayerItem[][] inventory=saveInventory(player);
  plugin.inventories.put(inventoryName,inventory);
  plugin.debugger.debugEvent(MultiInvEvent.INVENTORY_SAVE,new String[]{inventoryName});
  plugin.serialize();
}

Fixed version (ground truth):
public void storeWorldInventory(Player player,String world){
  if (plugin.sharesMap.containsKey(world)) {
    world=plugin.sharesMap.get(world);
  }
  String inventoryName=player.getName() + "String_Node_Str" + world;
  MultiInvPlayerItem[][] inventory=saveInventory(player);
  plugin.inventories.put(inventoryName,inventory);
  plugin.debugger.debugEvent(MultiInvEvent.INVENTORY_SAVE,new String[]{inventoryName});
  plugin.serialize();
}
Program: 84883
Project: 84883
Buggy source:
public void loadWorldInventory(Player player,String world){
  boolean newMember=true;
  if (plugin.sharesMap.contains(world)) {
    world=plugin.sharesMap.get(world);
  }
  String worldCheckName="String_Node_Str" + world;
  for (  String inventory : plugin.inventories.keySet()) {
    String[] parts=inventory.split("String_Node_Str");
    if (parts[0].equals(player.getName())) {
      newMember=false;
      if (parts[1].equals(worldCheckName)) {
        loadInventory(plugin.inventories.get(inventory),player);
        plugin.debugger.debugEvent(MultiInvEvent.INVENTORY_LOAD,new String[]{inventory});
      }
    }
  }
  if (!newMember) {
    loadNewInventory(player);
  }
}

Fixed version (ground truth):
public void loadWorldInventory(Player player,String world){
  boolean newMember=true;
  if (plugin.sharesMap.containsKey(world)) {
    world=plugin.sharesMap.get(world);
  }
  String worldCheckName="String_Node_Str" + world;
  for (  String inventory : plugin.inventories.keySet()) {
    String[] parts=inventory.split("String_Node_Str");
    if (parts[0].equals(player.getName())) {
      newMember=false;
      if (parts[1].equals(worldCheckName)) {
        loadInventory(plugin.inventories.get(inventory),player);
        plugin.debugger.debugEvent(MultiInvEvent.INVENTORY_LOAD,new String[]{inventory});
        return;
      }
    }
  }
  if (!newMember) {
    loadNewInventory(player);
  }
}
Program: 84884
Project: 84884
Buggy source:
public boolean parseShares(){
  ArrayList<String> lines=createShares();
  ArrayList<String> worldList=new ArrayList<String>();
  for (  String line : lines) {
    String[] content=line.split("String_Node_Str");
    if (content[0] != "String_Node_Str") {
      String[] worlds=content[0].split("String_Node_Str");
      if (plugin.getServer().getWorld(worlds[0]) == null) {
        MultiInv.log.info("String_Node_Str" + MultiInv.pluginName + "String_Node_Str"+ worlds[0]);
        return false;
      }
 else {
        if (worldList.contains(worlds[0])) {
          MultiInv.log.info("String_Node_Str" + MultiInv.pluginName + "String_Node_Str"+ worlds[0]);
          return false;
        }
        worldList.add(worlds[0]);
        int i=1;
        while (i < worlds.length) {
          if (plugin.getServer().getWorld(worlds[i]) == null) {
            MultiInv.log.info("String_Node_Str" + MultiInv.pluginName + "String_Node_Str"+ worlds[i]);
          }
 else {
            if (worldList.contains(worlds[i])) {
              MultiInv.log.info("String_Node_Str" + MultiInv.pluginName + "String_Node_Str"+ worlds[i]);
              return false;
            }
 else {
              plugin.sharesMap.put(worlds[1],worlds[0]);
            }
          }
          i++;
        }
      }
    }
  }
  return true;
}

Fixed version (ground truth):
public boolean parseShares(){
  ArrayList<String> lines=createShares();
  ArrayList<String> worldList=new ArrayList<String>();
  for (  String line : lines) {
    String[] content=line.split("String_Node_Str");
    if ((content[0].matches("String_Node_Str"))) {
      String[] worlds=content[0].split("String_Node_Str");
      if (plugin.getServer().getWorld(worlds[0]) == null) {
        MultiInv.log.info("String_Node_Str" + MultiInv.pluginName + "String_Node_Str"+ worlds[0]);
        return false;
      }
 else {
        if (worldList.contains(worlds[0])) {
          MultiInv.log.info("String_Node_Str" + MultiInv.pluginName + "String_Node_Str"+ worlds[0]);
          return false;
        }
        worldList.add(worlds[0]);
        int i=1;
        while (i < worlds.length) {
          if (plugin.getServer().getWorld(worlds[i]) == null) {
            MultiInv.log.info("String_Node_Str" + MultiInv.pluginName + "String_Node_Str"+ worlds[i]);
          }
 else {
            if (worldList.contains(worlds[i])) {
              MultiInv.log.info("String_Node_Str" + MultiInv.pluginName + "String_Node_Str"+ worlds[i]);
              return false;
            }
 else {
              plugin.sharesMap.put(worlds[i],worlds[0]);
            }
          }
          i++;
        }
      }
    }
  }
  return true;
}
Program: 84885
Project: 84885
Buggy source:
@Override public boolean onOptionsItemSelected(MenuItem item){
  Intent intent=new Intent();
switch (item.getItemId()) {
case MENU_MANAGE:
    Intent open=new Intent();
  open.setClass(MyGoogleMap.this,mlist.class);
timer.cancel();
MyGoogleMap.this.finish();
startActivity(open);
return true;
case MENU_EXIT:
timer.cancel();
MyGoogleMap.this.finish();
break;
}
return true;
}

Fixed version (ground truth):
@Override public boolean onOptionsItemSelected(MenuItem item){
  Intent intent=new Intent();
switch (item.getItemId()) {
case MENU_MANAGE:
    Intent open=new Intent();
  open.setClass(MyGoogleMap.this,mlist.class);
timer.cancel();
MyGoogleMap.this.finish();
startActivity(open);
return true;
case MENU_EXIT:
timer.cancel();
android.os.Process.killProcess(android.os.Process.myPid());
MyGoogleMap.this.finish();
break;
}
return true;
}
Program: 84886
Project: 84886
Buggy source:
public static void save(){
  String policy=params.get("String_Node_Str");
  System.err.println("String_Node_Str" + policy);
  String identity=PolicyManager.sharedManager().save(policy);
  String success=identity == null ? "String_Node_Str" : "String_Node_Str";
  renderJSON(new ResponseMessage(success,identity));
}

Fixed version (ground truth):
public static void save(){
  String policy=params.get("String_Node_Str");
  Logger.info("String_Node_Str",policy);
  String identity=PolicyManager.sharedManager().save(policy);
  String success=identity == null ? "String_Node_Str" : "String_Node_Str";
  renderJSON(new ResponseMessage(success,identity));
}
Program: 84887
Project: 84887
Buggy source:
@Override public void run(){
  init();
  try {
    while (true) {
      if (!rpc.isConnected()) {
        try {
          Logger.info("String_Node_Str");
          rpc.connect(InetAddress.getByName(hwdbHost),987);
          Logger.info("String_Node_Str");
        }
 catch (        final Exception e) {
          Logger.error("String_Node_Str",e.getMessage());
        }
      }
      while (rpc.isConnected()) {
        try {
          updateLeases();
          for (          Query q : PolicyManager.sharedManager().activePolicies.values()) {
            String query=q.toString();
            if (q != null) {
              try {
                String result=rpc.call(query);
                if (result != null)                 q.process(result);
              }
 catch (              IOException e) {
                e.printStackTrace();
              }
            }
          }
        }
 catch (        final Exception e) {
          Logger.error("String_Node_Str",e.getMessage());
        }
        try {
          Thread.sleep(TIME_DELTA);
        }
 catch (        final Exception e) {
        }
      }
      try {
        Thread.sleep(5000);
      }
 catch (      final Exception e) {
      }
    }
  }
 catch (  final Exception e) {
    Logger.error("String_Node_Str",e.getMessage());
  }
}

Fixed version (ground truth):
@Override public void run(){
  init();
  try {
    while (true) {
      if (!rpc.isConnected()) {
        try {
          Logger.info("String_Node_Str");
          rpc.connect(InetAddress.getByName(hwdbHost),987);
          Logger.info("String_Node_Str");
        }
 catch (        final Exception e) {
          Logger.error("String_Node_Str",e.getMessage());
        }
      }
      while (rpc.isConnected()) {
        try {
          updateLeases();
          for (          Query q : PolicyManager.sharedManager().activePolicies.values()) {
            if (q != null) {
              String query=q.toString();
              try {
                String result=rpc.call(query);
                if (result != null)                 q.process(result);
              }
 catch (              IOException e) {
                e.printStackTrace();
              }
            }
          }
        }
 catch (        final Exception e) {
          Logger.error("String_Node_Str",e.getMessage());
        }
        try {
          Thread.sleep(TIME_DELTA);
        }
 catch (        final Exception e) {
        }
      }
      try {
        Thread.sleep(5000);
      }
 catch (      final Exception e) {
      }
    }
  }
 catch (  final Exception e) {
    Logger.error("String_Node_Str",e.getMessage());
  }
}
Program: 84888
Project: 84888
Buggy source:
public Long[] getLatestActivity(String device){
  String query=null;
  try {
    String ipaddr=LeaseData.sharedData().lookup(device);
    if (ipaddr != null) {
      if (lastactivity > 0) {
        final String s=String.format("String_Node_Str",lastactivity * 1000000);
        query=String.format("String_Node_Str",s,ipaddr);
      }
 else {
        query=String.format("String_Node_Str",ipaddr);
      }
      return processactivity(rpc.call(query),ipaddr);
    }
 else {
      Logger.info("String_Node_Str",device);
    }
  }
 catch (  IOException e) {
    Logger.error(e,"String_Node_Str");
  }
  return null;
}

Fixed version (ground truth):
public Long[] getLatestActivity(String device){
  String query=null;
  try {
    String ipaddr=LeaseData.sharedData().lookup(device);
    if (ipaddr != null) {
      if (lastactivity > 0) {
        final String s=String.format("String_Node_Str",lastactivity * 1000000);
        query=String.format("String_Node_Str",s,ipaddr);
      }
 else {
        query=String.format("String_Node_Str",ipaddr);
      }
      return processactivity(rpc.call(query),ipaddr);
    }
 else {
      Logger.info("String_Node_Str",device);
    }
  }
 catch (  IOException e) {
    Logger.error(e,"String_Node_Str");
  }
  return new Long[]{System.currentTimeMillis(),0L};
}
Program: 84889
Project: 84889
Buggy source:
public Long getLatestBandwidth(String device){
  String query=null;
  try {
    String ipaddr=LeaseData.sharedData().lookup(device);
    if (ipaddr != null) {
      if (lastbwrequest > 0) {
        final String s=String.format("String_Node_Str",lastbwrequest * 1000000);
        query=String.format("String_Node_Str",s,ipaddr,ipaddr);
      }
 else {
        query=String.format("String_Node_Str",ipaddr,ipaddr);
      }
      return processbwidth(rpc.call(query),ipaddr);
    }
 else {
      Logger.info("String_Node_Str",device);
    }
  }
 catch (  IOException e) {
    Logger.error(e,"String_Node_Str");
  }
  return 0L;
}

Fixed version (ground truth):
public Long[] getLatestBandwidth(String device){
  String sinceLastQuery=null;
  String withinTimeRangeQuery=null;
  try {
    String ipaddr=LeaseData.sharedData().lookup(device);
    if (ipaddr != null) {
      if (lastbwrequest > 0) {
        Logger.info("String_Node_Str",new Date(lastbwrequest).toString());
        final String s=String.format("String_Node_Str",lastbwrequest * 1000000);
        sinceLastQuery=String.format("String_Node_Str",s,BandwidthQuery.subnet,BandwidthQuery.subnet);
      }
 else {
        sinceLastQuery=String.format("String_Node_Str",BandwidthQuery.subnet,BandwidthQuery.subnet);
      }
      withinTimeRangeQuery=String.format("String_Node_Str",BandwidthQuery.timeRange,BandwidthQuery.subnet,BandwidthQuery.subnet);
      Logger.info("String_Node_Str",sinceLastQuery);
      Logger.info("String_Node_Str",withinTimeRangeQuery);
      String tr=rpc.call(withinTimeRangeQuery);
      String sl=rpc.call(sinceLastQuery);
      Long sinceLastBytes=processbandwidth(sl,ipaddr);
      Long timeRangeBytes=processbandwidth(tr,ipaddr);
      return new Long[]{sinceLastBytes,timeRangeBytes,BandwidthQuery.BANDWIDTH_LIMIT};
    }
 else {
      Logger.info("String_Node_Str",device);
    }
  }
 catch (  IOException e) {
    Logger.error(e,"String_Node_Str");
  }
  return new Long[]{0L,0L,BandwidthQuery.BANDWIDTH_LIMIT};
}
Program: 84890
Project: 84890
Buggy source:
@Override public void process(String data){
  String[] rows=data.split("String_Node_Str");
  last=0;
  if (rows.length > 2) {
    for (int i=2; i < rows.length; i++) {
      System.err.println(rows[i]);
      String row[]=rows[i].split(DELIMETER);
      if (row[1].equals(ipaddr)) {
        if (Long.valueOf(row[0]) >= triggerbytes) {
          Logger.info("String_Node_Str");
          triggered=true;
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void process(String data){
  String[] rows=data.split("String_Node_Str");
  last=0;
  if (rows.length > 2) {
    for (int i=2; i < rows.length; i++) {
      System.err.println(rows[i]);
      String row[]=rows[i].split(DELIMETER);
      if (row[1].equals(ipaddr)) {
        Logger.info("String_Node_Str",row[0],String.valueOf(triggerbytes));
        if (Long.valueOf(row[0]) >= triggerbytes) {
          Logger.info("String_Node_Str");
          triggered=true;
        }
      }
    }
  }
}
Program: 84891
Project: 84891
Buggy source:
@Override public void process(String data){
  processor.process(data);
  if (processor.triggered()) {
    processor.reset();
    for (    CallbackURL c : callbackurls)     c.call();
  }
}

Fixed version (ground truth):
@Override public void process(String data){
  processor.process(data);
  if (processor.triggered()) {
    for (    CallbackURL c : callbackurls)     c.call();
    PolicyManager.sharedManager().remove(policyid);
  }
}
Program: 84892
Project: 84892
Buggy source:
@Override public String toString(){
  final String s=String.format("String_Node_Str",startTime * 1000000);
  String thequery=query.replace("String_Node_Str","String_Node_Str" + s + "String_Node_Str");
  String ipaddr=null;
  if ((ipaddr=LeaseData.sharedData().lookup(subject)) != null) {
    thequery=thequery.replace("String_Node_Str",ipaddr);
    return thequery;
  }
  return null;
}

Fixed version (ground truth):
@Override public String toString(){
  String thequery=query.replace("String_Node_Str","String_Node_Str" + timeRange + "String_Node_Str");
  thequery=thequery.replace("String_Node_Str",subnet);
  return thequery;
}
Program: 84893
Project: 84893
Buggy source:
public void doJob(){
  System.err.println("String_Node_Str");
  new PollingThread().start();
}

Fixed version (ground truth):
public void doJob(){
  new PollingThread().start();
}
Program: 84894
Project: 84894
Buggy source:
private void init(){
  try {
    mactoip=new Hashtable<String,String>();
  }
 catch (  Exception e) {
    System.err.println("String_Node_Str" + e.getMessage());
  }
}

Fixed version (ground truth):
private void init(){
  mactoip=new Hashtable<String,String>();
}
Program: 84895
Project: 84895
Buggy source:
public String lookup(String macaddr){
  System.err.println("String_Node_Str" + macaddr);
  return mactoip.get(macaddr.toLowerCase());
}

Fixed version (ground truth):
public String lookup(String macaddr){
  return mactoip.get(macaddr.toLowerCase());
}
Program: 84896
Project: 84896
Buggy source:
public void parse(String data){
  String[] rows=data.split("String_Node_Str");
  if (rows.length > 2) {
    for (int i=2; i < rows.length; i++) {
      System.err.println(rows[i]);
      String row[]=rows[i].split(DELIMETER);
      last=Util.convertTs(row[0]) + 1;
      if (row[3].equals("String_Node_Str")) {
        System.out.println("String_Node_Str" + row[1].toLowerCase() + "String_Node_Str"+ row[2]);
        mactoip.put(row[1].toLowerCase(),row[2]);
      }
    }
  }
}

Fixed version (ground truth):
public void parse(String data){
  if (data == null)   return;
  String[] rows=data.split("String_Node_Str");
  if (rows.length > 2) {
    for (int i=2; i < rows.length; i++) {
      System.err.println(rows[i]);
      String row[]=rows[i].split(DELIMETER);
      last=Util.convertTs(row[0]) + 1;
      if (row[3].equals("String_Node_Str")) {
        Logger.info("String_Node_Str" + row[1].toLowerCase() + "String_Node_Str"+ row[2]);
        mactoip.put(row[1].toLowerCase(),row[2]);
      }
    }
  }
}
Program: 84897
Project: 84897
Buggy source:
@Override public void run(){
  init();
  System.err.println("String_Node_Str");
  try {
    while (true) {
      if (!rpc.isConnected()) {
        try {
          System.err.println("String_Node_Str");
          rpc.connect(InetAddress.getByName(hwdbHost),987);
          System.err.println("String_Node_Str");
        }
 catch (        final Exception e) {
          logger.log(Level.SEVERE,e.getMessage(),e);
        }
      }
      while (rpc.isConnected()) {
        try {
          updateLeases();
          for (          Query q : PolicyManager.sharedManager().activePolicies.values()) {
            String query=q.toString();
            if (q != null) {
              try {
                System.err.println("String_Node_Str" + query);
                q.process(rpc.call(query));
              }
 catch (              IOException e) {
                e.printStackTrace();
              }
            }
          }
        }
 catch (        final Exception e) {
          logger.log(Level.SEVERE,e.getMessage(),e);
        }
        try {
          Thread.sleep(TIME_DELTA);
        }
 catch (        final Exception e) {
        }
      }
      try {
        Thread.sleep(5000);
      }
 catch (      final Exception e) {
      }
    }
  }
 catch (  final Exception e) {
    logger.log(Level.SEVERE,e.getMessage(),e);
  }
}

Fixed version (ground truth):
@Override public void run(){
  init();
  try {
    while (true) {
      if (!rpc.isConnected()) {
        try {
          Logger.info("String_Node_Str");
          rpc.connect(InetAddress.getByName(hwdbHost),987);
          Logger.info("String_Node_Str");
        }
 catch (        final Exception e) {
          Logger.error("String_Node_Str",e.getMessage());
        }
      }
      while (rpc.isConnected()) {
        try {
          updateLeases();
          for (          Query q : PolicyManager.sharedManager().activePolicies.values()) {
            String query=q.toString();
            if (q != null) {
              try {
                String result=rpc.call(query);
                if (result != null)                 q.process(result);
              }
 catch (              IOException e) {
                e.printStackTrace();
              }
            }
          }
        }
 catch (        final Exception e) {
          Logger.error("String_Node_Str",e.getMessage());
        }
        try {
          Thread.sleep(TIME_DELTA);
        }
 catch (        final Exception e) {
        }
      }
      try {
        Thread.sleep(5000);
      }
 catch (      final Exception e) {
      }
    }
  }
 catch (  final Exception e) {
    Logger.error("String_Node_Str",e.getMessage());
  }
}
Program: 84900
Project: 84900
Buggy source:
public <T>T translateBean(T bean,String languageCode,boolean deep,boolean detached){
  System.err.println("String_Node_Str" + bean.toString() + "String_Node_Str"+ languageCode+ "String_Node_Str"+ deep+ "String_Node_Str");
  if (bean == null) {
    return null;
  }
  if (!detached) {
    bean=JpaEx.serializeAndDeserialize(bean);
  }
  if (bean instanceof Collection) {
    return (T)translateBeans((Collection)bean,languageCode,deep,true);
  }
 else   if (bean instanceof Map) {
    Map<Object,Object> m=(Map<Object,Object>)bean;
    for (    Map.Entry<Object,Object> e : m.entrySet()) {
      Object tv=translateBean(e.getValue(),languageCode,deep,true);
      m.put(e.getKey(),tv);
    }
    return (T)m;
  }
 else   if (bean.getClass().isAnnotationPresent(Entity.class)) {
    Collection<T> rb=translateBeans(Collections.<T>singletonList(bean),languageCode,deep,true);
    return rb.iterator().next();
  }
 else {
    return bean;
  }
}

Fixed version (ground truth):
public <T>T translateBean(T bean,String languageCode,boolean deep,boolean detached){
  if (bean == null) {
    return null;
  }
  if (!detached) {
    bean=JpaEx.getInstance().detached(getEntityManager(),bean);
  }
  if (bean instanceof Collection) {
    return (T)translateBeans((Collection)bean,languageCode,deep,true);
  }
 else   if (bean instanceof Map) {
    Map<Object,Object> m=(Map<Object,Object>)bean;
    for (    Map.Entry<Object,Object> e : m.entrySet()) {
      Object tv=translateBean(e.getValue(),languageCode,deep,true);
      m.put(e.getKey(),tv);
    }
    return (T)m;
  }
 else   if (bean.getClass().isAnnotationPresent(Entity.class)) {
    Collection<T> rb=translateBeans(Collections.<T>singletonList(bean),languageCode,deep,true);
    return rb.iterator().next();
  }
 else {
    return bean;
  }
}
Program: 84901
Project: 84901
Buggy source:
private <T>void fillEntityEntry(EntityCacheEntry<T> entry){
  List<JpaEntityProperty> properties=JpaHelper.getAllJpaProperties(entry.entityClass);
  entry.stringPropertiesByNormalizedColumnName=new TreeMap<String,JpaEntityProperty<T,String>>();
  entry.stringPropertiesByName=new TreeMap<String,JpaEntityProperty<T,String>>();
  System.err.println("String_Node_Str" + entry.entityClass.getName());
  for (  JpaEntityProperty p : properties) {
    boolean used=false;
    if (p.getPropertyClass().isAssignableFrom(String.class)) {
      System.err.println("String_Node_Str" + p.getName() + "String_Node_Str"+ p.getColumnName());
      entry.stringPropertiesByNormalizedColumnName.put(normalizeColumnName(p.getColumnName()),p);
      entry.stringPropertiesByName.put(p.getName(),p);
      used=true;
    }
 else     if (p.isId()) {
      entry.idProperty=p;
    }
    if (used) {
      Class propertyOwnerClass=p.getEntityClass();
      if (!entry.entityClass.equals(propertyOwnerClass)) {
        String propertyOwnerClassName=propertyOwnerClass.getName();
        if (!entry.slicedEntries.containsKey(propertyOwnerClassName)) {
          EntityCacheEntry propertyOwnerCacheEntry=getOrCreateEntityCacheEntry(propertyOwnerClassName);
          if (propertyOwnerCacheEntry != null) {
            entry.slicedEntries.put(propertyOwnerClassName,propertyOwnerCacheEntry);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
private <T>void fillEntityEntry(EntityCacheEntry<T> entry){
  List<JpaEntityProperty> properties=JpaHelper.getAllJpaProperties(entry.entityClass);
  entry.stringPropertiesByNormalizedColumnName=new TreeMap<String,JpaEntityProperty<T,String>>();
  entry.stringPropertiesByName=new TreeMap<String,JpaEntityProperty<T,String>>();
  for (  JpaEntityProperty p : properties) {
    boolean used=false;
    if (p.getPropertyClass().isAssignableFrom(String.class)) {
      entry.stringPropertiesByNormalizedColumnName.put(normalizeColumnName(p.getColumnName()),p);
      entry.stringPropertiesByName.put(p.getName(),p);
      used=true;
    }
 else     if (p.isId()) {
      entry.idProperty=p;
    }
    if (used) {
      Class propertyOwnerClass=p.getEntityClass();
      if (!entry.entityClass.equals(propertyOwnerClass)) {
        String propertyOwnerClassName=propertyOwnerClass.getName();
        if (!entry.slicedEntries.containsKey(propertyOwnerClassName)) {
          EntityCacheEntry propertyOwnerCacheEntry=getOrCreateEntityCacheEntry(propertyOwnerClassName);
          if (propertyOwnerCacheEntry != null) {
            entry.slicedEntries.put(propertyOwnerClassName,propertyOwnerCacheEntry);
          }
        }
      }
    }
  }
}
Program: 84903
Project: 84903
Buggy source:
public <T>T translateBean(T bean,String languageCode,boolean deep){
  if (bean instanceof Collection) {
    return (T)translateBeans((Collection)bean,languageCode,deep);
  }
 else   if (bean instanceof Map) {
    Map<Object,Object> m=(Map<Object,Object>)bean;
    for (    Map.Entry<Object,Object> e : m.entrySet()) {
      Object tv=translateBean(e.getValue(),languageCode,deep);
      m.put(e.getKey(),tv);
    }
    return (T)m;
  }
 else   if (bean.getClass().isAnnotationPresent(Entity.class)) {
    Collection<T> rb=translateBeans(Collections.<T>singletonList(bean),languageCode,deep);
    return rb.iterator().next();
  }
 else {
    return bean;
  }
}

Fixed version (ground truth):
public <T>T translateBean(T bean,String languageCode,boolean deep){
  if (bean == null) {
    return null;
  }
 else   if (bean instanceof Collection) {
    return (T)translateBeans((Collection)bean,languageCode,deep);
  }
 else   if (bean instanceof Map) {
    Map<Object,Object> m=(Map<Object,Object>)bean;
    for (    Map.Entry<Object,Object> e : m.entrySet()) {
      Object tv=translateBean(e.getValue(),languageCode,deep);
      m.put(e.getKey(),tv);
    }
    return (T)m;
  }
 else   if (bean.getClass().isAnnotationPresent(Entity.class)) {
    Collection<T> rb=translateBeans(Collections.<T>singletonList(bean),languageCode,deep);
    return rb.iterator().next();
  }
 else {
    return bean;
  }
}
Program: 84904
Project: 84904
Buggy source:
private static boolean checkMethodPermission(Method method,Object[] params,UserServerContext user,String name,String[] arguments){
  Map<String,String> mapargs=null;
  if (arguments != null) {
    if ((arguments.length % 2) == 0) {
      throw new IllegalArgumentException("String_Node_Str");
    }
    mapargs=new TreeMap<String,String>();
    for (int i=0; i < arguments.length; i+=2) {
      String argname=arguments[i];
      String argvalue=arguments[i + 1];
      if (argvalue.startsWith("String_Node_Str")) {
        try {
          int argNumber=Integer.parseInt(argvalue.substring(1));
          argvalue=params[argNumber].toString();
        }
 catch (        NumberFormatException ex) {
          throw new IllegalArgumentException("String_Node_Str");
        }
      }
      mapargs.put(argname,argvalue);
    }
  }
 else {
    mapargs=Collections.<String,String>emptyMap();
  }
  return user.checkPermission(name,mapargs);
}

Fixed version (ground truth):
private static boolean checkMethodPermission(Method method,Object[] params,UserServerContext user,String name,String[] arguments){
  Map<String,String> mapargs=null;
  if (arguments != null) {
    if ((arguments.length % 2) != 0) {
      throw new IllegalArgumentException("String_Node_Str");
    }
    mapargs=new TreeMap<String,String>();
    for (int i=0; i < arguments.length; i+=2) {
      String argname=arguments[i];
      String argvalue=arguments[i + 1];
      if (argvalue.startsWith("String_Node_Str")) {
        try {
          int argNumber=Integer.parseInt(argvalue.substring(1));
          argvalue=params[argNumber].toString();
        }
 catch (        NumberFormatException ex) {
          throw new IllegalArgumentException("String_Node_Str");
        }
      }
      mapargs.put(argname,argvalue);
    }
  }
 else {
    mapargs=Collections.<String,String>emptyMap();
  }
  return user.checkPermission(name,mapargs);
}
Program: 84907
Project: 84907
Buggy source:
/** 
 * get security annotation for method. Unlike method.getAnnotation() method, check not only in supreclasses, but in interfaces.
 */
private static <T>T findAnnotation(Method m,Class<T> annotationClass){
  Annotation retval=authAnnotationsHash_.get(m);
  if (retval == null) {
    Class cls=m.getDeclaringClass();
    retval=cls.getAnnotation(annotationClass);
    if (retval == null) {
      Class[] interfaces=cls.getInterfaces();
      for (int i=0; i < interfaces.length; ++i) {
        retval=interfaces[i].getAnnotation(annotationClass);
        if (retval != null) {
          break;
        }
      }
    }
  }
  if (retval != null) {
    authAnnotationsHash_.put(m,retval);
    return (T)retval;
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * get security annotation for method. Unlike method.getAnnotation() method, check not only in supreclasses, but in interfaces.
 */
private static <T extends Annotation>T findAnnotation(Method m,Class<T> annotationClass){
  System.err.print("String_Node_Str" + annotationClass.getName() + "String_Node_Str"+ m);
  Annotation retval=authAnnotationsHash_.get(m);
  if (retval == null) {
    retval=m.getAnnotation(annotationClass);
    if (retval == null) {
      Class cls=m.getDeclaringClass();
      Class[] interfaces=cls.getInterfaces();
      for (int i=0; i < interfaces.length; ++i) {
        try {
          Method mi=interfaces[i].getMethod(m.getName(),m.getParameterTypes());
          retval=mi.getAnnotation(annotationClass);
        }
 catch (        NoSuchMethodException ex) {
          continue;
        }
        if (retval != null) {
          break;
        }
      }
    }
  }
  if (retval != null) {
    System.err.println("String_Node_Str");
    authAnnotationsHash_.put(m,retval);
    return (T)retval;
  }
 else {
    System.err.println("String_Node_Str");
    return null;
  }
}
Program: 84908
Project: 84908
Buggy source:
public boolean checkPermission(String permissionName,Map<String,String> permissionArguments){
  if (!inversePermissions_) {
    return !permissions_.contains(permissionName);
  }
 else {
    return permissions_.contains(permissionName);
  }
}

Fixed version (ground truth):
public boolean checkPermission(String permissionName,Map<String,String> permissionArguments){
  boolean retval;
  System.err.println("String_Node_Str" + permissionName + "String_Node_Str"+ login_);
  if (inversePermissions_) {
    retval=!permissions_.contains(permissionName);
  }
 else {
    retval=permissions_.contains(permissionName);
  }
  System.err.println("String_Node_Str" + retval);
  return retval;
}
Program: 84909
Project: 84909
Buggy source:
public UserRecord(String userId_){
  String msg=userId_ + Long.toHexString(System.currentTimeMillis()) + Integer.toHexString(random.nextInt());
  sessionTicket_=md5Hash(msg);
}

Fixed version (ground truth):
public UserRecord(String userId){
  userId_=userId;
  String msg=userId_ + Long.toHexString(System.currentTimeMillis()) + Integer.toHexString(random.nextInt());
  sessionTicket_=md5Hash(msg);
}
Program: 84910
Project: 84910
Buggy source:
/** 
 * substitue named parameters in string part, where we know that part does not contains string literals.
 */
private static void substituteNamedParametersInPart(int index,String part,StringBuilder qb,List<Object> posParams,Map<String,Object> namedParams){
  int sqlPositionParameterIndex=1;
  int varIndex=index;
  char[] arr=part.toCharArray();
  while (varIndex < arr.length) {
    while (varIndex < arr.length && arr[varIndex] != ':') {
      qb.append(arr[varIndex]);
      ++varIndex;
    }
    if (varIndex != arr.length) {
      boolean found=false;
      int i=++varIndex;
      for (; i < arr.length && !found; ++i) {
        if (!Character.isLetterOrDigit(arr[i])) {
          found=true;
        }
      }
      if (i == varIndex) {
        throw new IllegalArgumentException("String_Node_Str");
      }
      String varName=part.substring(varIndex,i);
      Object varValue=namedParams.get(varName);
      if (varValue == null) {
        throw new IllegalArgumentException("String_Node_Str" + varName + "String_Node_Str");
      }
      qb.append("String_Node_Str");
      posParams.add(varValue);
      ++sqlPositionParameterIndex;
      varIndex=i;
    }
  }
}

Fixed version (ground truth):
/** 
 * substitue named parameters in string part, where we know that part does not contains string literals.
 */
private static void substituteNamedParametersInPart(int index,String part,StringBuilder qb,List<Object> posParams,Map<String,Object> namedParams){
  int sqlPositionParameterIndex=1;
  int varIndex=index;
  char[] arr=part.toCharArray();
  while (varIndex < arr.length) {
    while (varIndex < arr.length && arr[varIndex] != ':') {
      qb.append(arr[varIndex]);
      ++varIndex;
    }
    if (varIndex != arr.length) {
      boolean found=false;
      int i=++varIndex;
      for (; i < arr.length && !found; ++i) {
        if (!Character.isLetterOrDigit(arr[i])) {
          found=true;
          break;
        }
      }
      if (i == varIndex) {
        throw new IllegalArgumentException("String_Node_Str");
      }
      String varName=part.substring(varIndex,i);
      Object varValue=namedParams.get(varName);
      if (varValue == null) {
        throw new IllegalArgumentException("String_Node_Str" + varName + "String_Node_Str");
      }
      qb.append("String_Node_Str");
      posParams.add(varValue);
      ++sqlPositionParameterIndex;
      varIndex=i;
    }
  }
}
Program: 84911
Project: 84911
Buggy source:
/** 
 * substitue named parameters in string part, where we know that part does not contains string literals.
 */
private static void substituteNamedParametersInPart(int index,String part,StringBuilder qb,List<Object> posParams,Map<String,Object> namedParams){
  int sqlPositionParameterIndex=1;
  int varIndex=index;
  char[] arr=part.toCharArray();
  while (varIndex < arr.length) {
    while (varIndex < arr.length && arr[varIndex] != ':') {
      qb.append(arr[varIndex]);
      ++varIndex;
    }
    if (varIndex != arr.length) {
      boolean found=false;
      int i=++varIndex;
      for (; i < arr.length && !found; ++i) {
        if (!Character.isLetterOrDigit(arr[i])) {
          found=true;
          break;
        }
      }
      if (i == varIndex) {
        throw new IllegalArgumentException("String_Node_Str");
      }
      String varName=part.substring(varIndex,i);
      Object varValue=namedParams.get(varName);
      if (varValue == null) {
        throw new IllegalArgumentException("String_Node_Str" + varName + "String_Node_Str");
      }
      qb.append("String_Node_Str");
      posParams.add(varValue);
      ++sqlPositionParameterIndex;
      varIndex=i;
    }
  }
}

Fixed version (ground truth):
/** 
 * substitue named parameters in string part, where we know that part does not contains string literals.
 */
private static void substituteNamedParametersInPart(int index,String part,StringBuilder qb,List<Object> posParams,Map<String,Object> namedParams){
  int sqlPositionParameterIndex=1;
  int varIndex=index;
  char[] arr=part.toCharArray();
  while (varIndex < arr.length) {
    while (varIndex < arr.length && arr[varIndex] != ':') {
      qb.append(arr[varIndex]);
      ++varIndex;
    }
    if (varIndex != arr.length) {
      boolean found=false;
      int i=++varIndex;
      for (; i < arr.length && !found; ++i) {
        if (!Character.isJavaIdentifierPart(arr[i])) {
          found=true;
          break;
        }
      }
      if (i == varIndex) {
        throw new IllegalArgumentException("String_Node_Str");
      }
      String varName=part.substring(varIndex,i);
      Object varValue=namedParams.get(varName);
      if (varValue == null) {
        throw new IllegalArgumentException("String_Node_Str" + varName + "String_Node_Str");
      }
      qb.append("String_Node_Str");
      posParams.add(varValue);
      ++sqlPositionParameterIndex;
      varIndex=i;
    }
  }
}
Program: 84912
Project: 84912
Buggy source:
@Override public Object getValue(int row,int col){
  return data.elementAt(row)[col];
}

Fixed version (ground truth):
@Override public Object getValue(int row,int col){
  return data[row][col];
}
Program: 84913
Project: 84913
Buggy source:
public DomDomMatrix(int numCols){
  this.numCols=numCols;
  data=new Vector<Object[]>();
}

Fixed version (ground truth):
public DomDomMatrix(DomainByInt aRowDomain,DomainByInt aColDomain){
  rowDomain=aRowDomain;
  colDomain=aColDomain;
  data=new Object[numRows()][numCols()];
}
Program: 84914
Project: 84914
Buggy source:
@Override public Object getValue(int row,int col){
  return data[row][col];
}

Fixed version (ground truth):
@Override public Object getValue(int row,int col){
  return data.elementAt(row)[col];
}
Program: 84915
Project: 84915
Buggy source:
public DomDomMatrixVectorArray(DomainByInt aRowDomain,DomainByInt aColDomain){
  rowDomain=aRowDomain;
  colDomain=aColDomain;
  data=new Object[numRows()][numCols()];
}

Fixed version (ground truth):
public DomDomMatrixVectorArray(int numCols){
  this.numCols=numCols;
  data=new Vector<Object[]>();
}
Program: 84916
Project: 84916
Buggy source:
public void update(){
  try {
    URL url=new URL("String_Node_Str");
    BufferedReader in=new BufferedReader(new InputStreamReader(url.openStream()));
    String str;
    while ((str=in.readLine()) != null) {
      int version=Integer.parseInt(str);
      if (version > minecod_version) {
        in.close();
        File directory=new File(getServer().getUpdateFolder());
        File plugin=new File(directory.getPath(),"String_Node_Str");
        download(log,new URL("String_Node_Str"),plugin);
        getServer().dispatchCommand(new ConsoleCommandSender(getServer()),"String_Node_Str");
        break;
      }
    }
    in.close();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public boolean update(){
  try {
    URL url=new URL("String_Node_Str");
    BufferedReader in=new BufferedReader(new InputStreamReader(url.openStream()));
    String str;
    while ((str=in.readLine()) != null) {
      int version=Integer.parseInt(str);
      if (version > minecod_version) {
        in.close();
        File directory=new File(getServer().getUpdateFolder());
        File plugin=new File(directory.getPath(),"String_Node_Str");
        download(log,new URL("String_Node_Str"),plugin);
        getServer().dispatchCommand(new ConsoleCommandSender(getServer()),"String_Node_Str");
        return true;
      }
    }
    in.close();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return false;
}
Program: 84917
Project: 84917
Buggy source:
@Override public void onEnable(){
  try {
    log=getServer().getLogger();
    update();
    uids.put("String_Node_Str",0);
    uids.put("String_Node_Str",1);
    uids.put("String_Node_Str",2);
    uids.put("String_Node_Str",3);
    setup();
  }
 catch (  Exception e) {
    e.printStackTrace();
    log.log(Level.SEVERE,"String_Node_Str" + e.getMessage());
    getServer().getPluginManager().disablePlugin(this);
  }
}

Fixed version (ground truth):
@Override public void onEnable(){
  try {
    log=getServer().getLogger();
    if (!update()) {
      uids.put("String_Node_Str",0);
      uids.put("String_Node_Str",1);
      uids.put("String_Node_Str",2);
      uids.put("String_Node_Str",3);
      setup();
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    log.log(Level.SEVERE,"String_Node_Str" + e.getMessage());
    getServer().getPluginManager().disablePlugin(this);
  }
}
Program: 84918
Project: 84918
Buggy source:
public void update(){
  List<Stat> r=new ArrayList<Stat>();
  for (  Stat i : newv) {
    plugin.sql.update("String_Node_Str" + p.dbid + "String_Node_Str"+ i.getId()+ "String_Node_Str"+ stats.get(i)+ "String_Node_Str");
    r.add(i);
  }
  newv.removeAll(r);
  updated.removeAll(r);
  r.clear();
  for (  Stat i : updated) {
    plugin.sql.update("String_Node_Str" + stats.get(i) + "String_Node_Str"+ p.dbid+ "String_Node_Str"+ i.getId()+ "String_Node_Str");
    r.add(i);
  }
  updated.removeAll(r);
  r.clear();
  for (  Achievement a : newa) {
    plugin.sql.update("String_Node_Str" + p.dbid + "String_Node_Str"+ a.getId()+ "String_Node_Str");
  }
  newa.clear();
}

Fixed version (ground truth):
public void update(){
synchronized (this) {
    List<Stat> r=new ArrayList<Stat>();
    for (    Stat i : newv) {
      plugin.sql.update("String_Node_Str" + p.dbid + "String_Node_Str"+ i.getId()+ "String_Node_Str"+ stats.get(i)+ "String_Node_Str");
      r.add(i);
    }
    newv.removeAll(r);
    updated.removeAll(r);
    r.clear();
    for (    Stat i : updated) {
      plugin.sql.update("String_Node_Str" + stats.get(i) + "String_Node_Str"+ p.dbid+ "String_Node_Str"+ i.getId()+ "String_Node_Str");
      r.add(i);
    }
    updated.removeAll(r);
    r.clear();
    for (    Achievement a : newa) {
      plugin.sql.update("String_Node_Str" + p.dbid + "String_Node_Str"+ a.getId()+ "String_Node_Str");
    }
    newa.clear();
  }
}
Program: 84919
Project: 84919
Buggy source:
public void incStat(Stat s,int c){
  if (stats.containsKey(s)) {
    updated.add(s);
  }
 else {
    newv.add(s);
  }
  int out=getStat(s) + c;
  if (out < 0) {
    out=0;
  }
  ArrayList<Achievement> tmp=new ArrayList<Achievement>();
  for (  Achievement a : toach) {
    if (a.getStat() == s && a.getCount() <= out) {
      tmp.add(a);
    }
  }
  for (  Achievement a : tmp) {
    awardAchievement(a);
  }
  stats.put(s,out);
}

Fixed version (ground truth):
public void incStat(Stat s,int c){
synchronized (this) {
    if (stats.containsKey(s)) {
      updated.add(s);
    }
 else {
      newv.add(s);
    }
    int out=getStat(s) + c;
    if (out < 0) {
      out=0;
    }
    ArrayList<Achievement> tmp=new ArrayList<Achievement>();
    for (    Achievement a : toach) {
      if (a.getStat() == s && a.getCount() <= out) {
        tmp.add(a);
      }
    }
    for (    Achievement a : tmp) {
      awardAchievement(a);
    }
    stats.put(s,out);
  }
}
Program: 84920
Project: 84920
Buggy source:
@Override public void onKill(player attacker,player defender,Location l){
  super.onKill(attacker,defender,l);
  attacker.addPoints(5);
  defender.addPoints(-2);
  int s=scores.containsKey(attacker) ? scores.get(attacker) + 1 : 1;
  scores.put(attacker,s);
  if (scores.get(attacker) >= 1) {
    onWin(attacker,attacker,defender);
  }
}

Fixed version (ground truth):
@Override public void onKill(player attacker,player defender,Location l){
  super.onKill(attacker,defender,l);
  attacker.addPoints(5);
  defender.addPoints(-2);
  int s=scores.containsKey(attacker) ? scores.get(attacker) + 1 : 1;
  scores.put(attacker,s);
  if (scores.get(attacker) >= 20) {
    onWin(attacker,attacker,defender);
  }
}
Program: 84922
Project: 84922
Buggy source:
public void destroy(){
  plugin.getServer().getScheduler().cancelTasks(plugin);
  try {
    BukkitContrib.getAppearanceManager().resetAllCloaks();
  }
 catch (  NoClassDefFoundError e) {
  }
  for (  claymore i : plugin.clays) {
    i.b.setType(Material.AIR);
  }
  for (  CWolfPack i : plugin.wolves) {
    i.removeAll();
  }
  for (  sentry i : plugin.sentries) {
    i.destroy();
  }
  for (  chopper i : plugin.choppers) {
    i.destroy();
  }
  plugin.clays.clear();
  plugin.wolves.clear();
  plugin.sentries.clear();
  plugin.choppers.clear();
  plugin.activeGame=false;
  t.cancel();
}

Fixed version (ground truth):
public void destroy(){
  plugin.getServer().getScheduler().cancelTask(t1);
  plugin.getServer().getScheduler().cancelTask(t2);
  plugin.getServer().getScheduler().cancelTask(t3);
  plugin.getServer().getScheduler().cancelTask(t4);
  try {
    BukkitContrib.getAppearanceManager().resetAllCloaks();
  }
 catch (  NoClassDefFoundError e) {
  }
  for (  claymore i : plugin.clays) {
    i.b.setType(Material.AIR);
  }
  for (  CWolfPack i : plugin.wolves) {
    i.removeAll();
  }
  for (  sentry i : plugin.sentries) {
    i.destroy();
  }
  for (  chopper i : plugin.choppers) {
    i.destroy();
  }
  plugin.clays.clear();
  plugin.wolves.clear();
  plugin.sentries.clear();
  plugin.choppers.clear();
  plugin.activeGame=false;
  t.cancel();
}
Program: 84923
Project: 84923
Buggy source:
public gamemode(main instance){
  plugin=instance;
  setup();
  lossmesssages.add("String_Node_Str");
  lossmesssages.add("String_Node_Str");
  lossmesssages.add("String_Node_Str");
  winmesssages.add("String_Node_Str");
  winmesssages.add("String_Node_Str");
  scheduleGame();
}

Fixed version (ground truth):
public gamemode(main instance){
  plugin=instance;
  setup();
  t4=plugin.getServer().getScheduler().scheduleSyncRepeatingTask(plugin,new tele(),4L,4L);
  lossmesssages.add("String_Node_Str");
  lossmesssages.add("String_Node_Str");
  lossmesssages.add("String_Node_Str");
  winmesssages.add("String_Node_Str");
  winmesssages.add("String_Node_Str");
  scheduleGame();
}
Program: 84924
Project: 84924
Buggy source:
public void startGame(){
  sendMessage(team.BOTH,plugin.d + "String_Node_Str");
  for (  Player p : plugin.players.keySet()) {
    plugin.p(p).resetScore();
    spawnPlayer(p,true);
  }
  plugin.getServer().getScheduler().scheduleSyncRepeatingTask(plugin,new tick(),40L,40L);
  plugin.getServer().getScheduler().scheduleSyncRepeatingTask(plugin,new tickone(),20L,20L);
  plugin.getServer().getScheduler().scheduleSyncRepeatingTask(plugin,new tickfast(),2L,2L);
}

Fixed version (ground truth):
public void startGame(){
  sendMessage(team.BOTH,plugin.d + "String_Node_Str");
  for (  Player p : plugin.players.keySet()) {
    plugin.p(p).resetScore();
    spawnPlayer(p,true);
  }
  t1=plugin.getServer().getScheduler().scheduleSyncRepeatingTask(plugin,new tick(),40L,40L);
  t2=plugin.getServer().getScheduler().scheduleSyncRepeatingTask(plugin,new tickone(),20L,20L);
  t3=plugin.getServer().getScheduler().scheduleSyncRepeatingTask(plugin,new tickfast(),2L,2L);
}
Program: 84925
Project: 84925
Buggy source:
public void playerjoin(PlayerJoinEvent event){
  plugin.setDoors();
  plugin.totele.add(event.getPlayer());
  t.schedule(new tele(),200);
  plugin.clearinv(event.getPlayer());
  String nick=event.getPlayer().getDisplayName();
  ResultSet r=plugin.sql.query("String_Node_Str" + event.getPlayer().getDisplayName() + "String_Node_Str");
  try {
    if (r.first()) {
      nick=r.getString("String_Node_Str");
    }
 else {
      int id=plugin.sql.update("String_Node_Str" + event.getPlayer().getDisplayName() + "String_Node_Str"+ event.getPlayer().getDisplayName()+ "String_Node_Str");
      plugin.sql.update("String_Node_Str" + id + "String_Node_Str");
    }
  }
 catch (  SQLException e) {
    e.printStackTrace();
  }
  event.setJoinMessage(plugin.d + "String_Node_Str" + plugin.join_msg.replaceAll("String_Node_Str",nick));
  event.getPlayer().sendMessage(plugin.d + "String_Node_Str" + plugin.welcome_msg);
  event.getPlayer().setHealth(20);
}

Fixed version (ground truth):
public void playerjoin(PlayerJoinEvent event){
  plugin.setDoors();
  plugin.totele.add(event.getPlayer());
  plugin.clearinv(event.getPlayer());
  String nick=event.getPlayer().getDisplayName();
  ResultSet r=plugin.sql.query("String_Node_Str" + event.getPlayer().getDisplayName() + "String_Node_Str");
  try {
    if (r.first()) {
      nick=r.getString("String_Node_Str");
    }
 else {
      int id=plugin.sql.update("String_Node_Str" + event.getPlayer().getDisplayName() + "String_Node_Str"+ event.getPlayer().getDisplayName()+ "String_Node_Str");
      plugin.sql.update("String_Node_Str" + id + "String_Node_Str");
    }
  }
 catch (  SQLException e) {
    e.printStackTrace();
  }
  event.setJoinMessage(plugin.d + "String_Node_Str" + plugin.join_msg.replaceAll("String_Node_Str",nick));
  event.getPlayer().sendMessage(plugin.d + "String_Node_Str" + plugin.welcome_msg);
  event.getPlayer().setHealth(20);
}