Program: 46741
Project: 46741
Buggy source:
@Command(aliases={"String_Node_Str","String_Node_Str"},usage="String_Node_Str",desc="String_Node_Str",min=1,flags="String_Node_Str") @CommandPermissions({"String_Node_Str","String_Node_Str"}) public static void create(final CommandContext args,final MyResidence plugin,final Nation nation,final Player player,final Session session) throws IncompleteRegionException, MyResidenceException {
  final Selection selection=plugin.getWorldEdit().getSelection(player);
  if (selection == null) {
    throw new IncompleteRegionException();
  }
  final boolean buildInWildness=args.hasFlag('w');
  if (buildInWildness && !session.hasPermission("String_Node_Str")) {
    throw new PermissionsDeniedException("String_Node_Str");
  }
 else   if (!session.hasPermission("String_Node_Str")) {
    throw new PermissionsDeniedException("String_Node_Str");
  }
  final Town town=nation.getTown(player.getLocation());
  if (!buildInWildness) {
    if (town == null) {
      throw new MyResidenceException("String_Node_Str");
    }
 else     if (!nation.getChunkManager().hasChunks(town,selection.getWorld(),selection.getRegionSelector().getRegion().getChunks())) {
      throw new MyResidenceException("String_Node_Str");
    }
  }
  session.setTask(new Runnable(){
    public void run(){
      final Residence residence=new Residence();
      residence.setName(args.getJoinedStrings(0));
      residence.setOwnerId(session.getPlayerId());
      if (!buildInWildness) {
        residence.setTownId(town.getId());
      }
      nation.getDatabase().save(residence);
      final ResidenceArea area=new ResidenceArea(selection);
      area.setResidenceId(residence.getId());
      nation.getDatabase().save(area);
      ResidenceSign sign=new ResidenceSign(session.getSelectedSign());
      sign.setResidenceId(residence.getId());
      nation.getDatabase().save(sign);
      Chat.sendMessage(player,"String_Node_Str",residence);
      plugin.getEventManager().callEvent(new ResidenceCreatedEvent(session,residence));
    }
  }
);
  session.setTaskActivator(Session.Activator.SELECT_SIGN);
  Chat.sendMessage(player,"String_Node_Str");
}

Fixed version (ground truth):
@Command(aliases={"String_Node_Str","String_Node_Str"},usage="String_Node_Str",desc="String_Node_Str",min=1,flags="String_Node_Str") @CommandPermissions({"String_Node_Str","String_Node_Str"}) public static void create(final CommandContext args,final MyResidence plugin,final Nation nation,final Player player,final Session session) throws IncompleteRegionException, MyResidenceException {
  final Selection selection=plugin.getWorldEdit().getSelection(player);
  if (selection == null) {
    throw new IncompleteRegionException();
  }
  final boolean buildInWildness=args.hasFlag('w');
  if (buildInWildness && !session.hasPermission("String_Node_Str")) {
    throw new PermissionsDeniedException("String_Node_Str");
  }
 else   if (!session.hasPermission("String_Node_Str")) {
    throw new PermissionsDeniedException("String_Node_Str");
  }
  final Town town=nation.getTown(player.getLocation());
  if (!buildInWildness) {
    if (town == null) {
      throw new MyResidenceException("String_Node_Str");
    }
 else     if (!nation.getChunkManager().hasChunks(town,selection.getWorld(),selection.getRegionSelector().getRegion().getChunks())) {
      throw new MyResidenceException("String_Node_Str");
    }
  }
  session.setTask(new Runnable(){
    public void run(){
      final Residence residence=new Residence();
      residence.setName(args.getJoinedStrings(0));
      residence.setOwnerId(session.getPlayerId());
      if (!buildInWildness) {
        residence.setTownId(town.getId());
      }
      nation.save(residence);
      ResidenceManager manager=nation.getResidenceManager(residence);
      manager.setSign(session.getSelectedSignBlock());
      manager.setArea(selection);
      Chat.sendMessage(player,"String_Node_Str",residence);
      plugin.info("String_Node_Str",residence,residence.getId(),player.getName());
      plugin.getEventManager().callEvent(new ResidenceCreatedEvent(session,residence));
    }
  }
);
  session.setTaskActivator(Session.Activator.SELECT_SIGN);
  Chat.sendMessage(player,"String_Node_Str");
}