Program: 42026
Project: 42026
Buggy source:
public boolean execute(ICommandSender sender,String[] args) throws Exception {
  IPlayer player=(IPlayer)sender;
  if (player.hasPermission(PermissionNames.USER_AUTO)) {
    if (manager.isPlotWorld(player) || plugin.getConfig().getBoolean("String_Node_Str")) {
      IWorld world;
      if (!manager.isPlotWorld(player) && plugin.getConfig().getBoolean("String_Node_Str")) {
        if (args.length == 2) {
          world=manager.getWorld(args[1]);
        }
 else {
          world=manager.getFirstWorld();
        }
        if (world == null) {
          player.sendMessage(C("String_Node_Str"));
          return true;
        }
        if (!manager.isPlotWorld(world)) {
          player.sendMessage(world + "String_Node_Str" + C("String_Node_Str"));
          return true;
        }
      }
 else {
        world=player.getWorld();
      }
      int playerLimit=getPlotLimit(player);
      int plotsOwned=manager.getOwnedPlotCount(player.getUniqueId(),world.getName().toLowerCase());
      if (playerLimit != -1 && plotsOwned >= playerLimit && !player.hasPermission("String_Node_Str")) {
        player.sendMessage(C("String_Node_Str") + "String_Node_Str" + plotsOwned+ "String_Node_Str"+ playerLimit+ "String_Node_Str"+ C("String_Node_Str")+ "String_Node_Str"+ C("String_Node_Str"));
        return true;
      }
      PlotMapInfo pmi=manager.getMap(world);
      int limit=pmi.getPlotAutoLimit();
      int x=0;
      int z=0;
      int dx=0;
      int dz=-1;
      int t=limit;
      int maxPlots=t * t;
      for (int i=0; i < maxPlots; i++) {
        if (-limit / 2 <= x && x <= limit / 2 && -limit / 2 <= z && z <= limit / 2) {
          PlotId id=new PlotId(x,z);
          if (manager.isPlotAvailable(id,pmi)) {
            double price=0.0;
            PlotCreateEvent event=new PlotCreateEvent(world,id,player);
            plugin.getEventBus().post(event);
            if (manager.isEconomyEnabled(pmi)) {
              price=pmi.getClaimPrice();
              if (serverBridge.has(player,price)) {
                player.sendMessage("String_Node_Str" + serverBridge.getEconomy().format(price) + "String_Node_Str");
                return true;
              }
 else {
                if (event.isCancelled()) {
                  return true;
                }
                EconomyResponse er=serverBridge.withdrawPlayer(player,price);
                if (!er.transactionSuccess()) {
                  player.sendMessage(er.errorMessage);
                  serverBridge.getLogger().warning(er.errorMessage);
                  return true;
                }
              }
            }
            if (!event.isCancelled()) {
              manager.createPlot(id,world,player.getName(),player.getUniqueId(),pmi);
              player.setLocation(manager.getPlotHome(id,player.getWorld()));
              player.sendMessage(C("String_Node_Str") + "String_Node_Str" + C("String_Node_Str")+ "String_Node_Str"+ C("String_Node_Str"));
              if (isAdvancedLogging()) {
                if (price == 0) {
                  serverBridge.getLogger().info(player.getName() + "String_Node_Str" + C("String_Node_Str")+ "String_Node_Str"+ id);
                }
 else {
                  serverBridge.getLogger().info(player.getName() + "String_Node_Str" + C("String_Node_Str")+ "String_Node_Str"+ id+ ("String_Node_Str" + C("String_Node_Str") + "String_Node_Str"+ price));
                }
              }
              return true;
            }
          }
        }
        if (x == z || x < 0 && x == -z || x > 0 && x == 1 - z) {
          t=dx;
          dx=-dz;
          dz=t;
        }
        x+=dx;
        z+=dz;
      }
      player.sendMessage(C("String_Node_Str"));
      return true;
    }
 else {
      player.sendMessage(C("String_Node_Str"));
    }
  }
 else {
    return false;
  }
  return true;
}

Fixed version (ground truth):
public boolean execute(ICommandSender sender,String[] args) throws Exception {
  IPlayer player=(IPlayer)sender;
  if (player.hasPermission(PermissionNames.USER_AUTO)) {
    if (manager.isPlotWorld(player) || plugin.getConfig().getBoolean("String_Node_Str")) {
      IWorld world;
      if (!manager.isPlotWorld(player) && plugin.getConfig().getBoolean("String_Node_Str")) {
        if (args.length == 2) {
          world=manager.getWorld(args[1]);
        }
 else {
          world=manager.getFirstWorld();
        }
        if (world == null) {
          player.sendMessage(C("String_Node_Str"));
          return true;
        }
        if (!manager.isPlotWorld(world)) {
          player.sendMessage(world + "String_Node_Str" + C("String_Node_Str"));
          return true;
        }
      }
 else {
        world=player.getWorld();
      }
      int playerLimit=getPlotLimit(player);
      int plotsOwned=manager.getOwnedPlotCount(player.getUniqueId(),world);
      if (playerLimit != -1 && plotsOwned >= playerLimit && !player.hasPermission("String_Node_Str")) {
        player.sendMessage(C("String_Node_Str") + "String_Node_Str" + plotsOwned+ "String_Node_Str"+ playerLimit+ "String_Node_Str"+ C("String_Node_Str")+ "String_Node_Str"+ C("String_Node_Str"));
        return true;
      }
      PlotMapInfo pmi=manager.getMap(world);
      int limit=pmi.getPlotAutoLimit();
      int x=0;
      int z=0;
      int dx=0;
      int dz=-1;
      int t=limit;
      int maxPlots=t * t;
      for (int i=0; i < maxPlots; i++) {
        if (-limit / 2 <= x && x <= limit / 2 && -limit / 2 <= z && z <= limit / 2) {
          PlotId id=new PlotId(x,z);
          if (manager.isPlotAvailable(id,pmi)) {
            double price=0.0;
            PlotCreateEvent event=new PlotCreateEvent(world,id,player);
            plugin.getEventBus().post(event);
            if (manager.isEconomyEnabled(pmi)) {
              price=pmi.getClaimPrice();
              if (serverBridge.has(player,price)) {
                player.sendMessage("String_Node_Str" + serverBridge.getEconomy().get().format(price) + "String_Node_Str");
                return true;
              }
 else {
                if (event.isCancelled()) {
                  return true;
                }
                EconomyResponse er=serverBridge.withdrawPlayer(player,price);
                if (!er.transactionSuccess()) {
                  player.sendMessage(er.errorMessage);
                  serverBridge.getLogger().warning(er.errorMessage);
                  return true;
                }
              }
            }
            if (!event.isCancelled()) {
              manager.createPlot(id,world,player.getName(),player.getUniqueId(),pmi);
              player.setLocation(manager.getPlotHome(id,player.getWorld()));
              player.sendMessage(C("String_Node_Str") + "String_Node_Str" + C("String_Node_Str")+ "String_Node_Str"+ C("String_Node_Str"));
              if (isAdvancedLogging()) {
                if (price == 0) {
                  serverBridge.getLogger().info(player.getName() + "String_Node_Str" + C("String_Node_Str")+ "String_Node_Str"+ id);
                }
 else {
                  serverBridge.getLogger().info(player.getName() + "String_Node_Str" + C("String_Node_Str")+ "String_Node_Str"+ id+ ("String_Node_Str" + C("String_Node_Str") + "String_Node_Str"+ price));
                }
              }
              return true;
            }
          }
        }
        if (x == z || x < 0 && x == -z || x > 0 && x == 1 - z) {
          t=dx;
          dx=-dz;
          dz=t;
        }
        x+=dx;
        z+=dz;
      }
      player.sendMessage(C("String_Node_Str"));
      return true;
    }
 else {
      player.sendMessage(C("String_Node_Str"));
    }
  }
 else {
    return false;
  }
  return true;
}