Program: 58002
Project: 58002
Buggy source:
@Override public boolean onCommand(final CommandCaller caller,final String[] args){
  final PlotPlayer plr=caller instanceof PlotPlayerCaller ? (PlotPlayer)caller.getSuperCaller() : null;
  if (args.length < 1) {
    noArgs(plr);
    return false;
  }
  int page=0;
  if (args.length > 1) {
    try {
      page=Integer.parseInt(args[1]);
      --page;
      if (page < 0) {
        page=0;
      }
    }
 catch (    final Exception e) {
      page=0;
    }
  }
  List<Plot> plots=null;
  String world;
  if (plr != null) {
    world=plr.getLocation().getWorld();
  }
 else {
    Set<String> worlds=PS.get().getPlotWorlds();
    if (worlds.size() == 0) {
      world="String_Node_Str";
    }
 else {
      world=worlds.iterator().next();
    }
  }
  String arg=args[0].toLowerCase();
  boolean sort=true;
switch (arg) {
case "String_Node_Str":
{
      if (plr == null) {
        break;
      }
      if (!Permissions.hasPermission(plr,"String_Node_Str")) {
        MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
        return false;
      }
      plots=new ArrayList<>(PS.get().getPlots(plr));
      break;
    }
case "String_Node_Str":
{
    if (plr == null) {
      break;
    }
    if (!Permissions.hasPermission(plr,"String_Node_Str")) {
      MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
      return false;
    }
    plots=new ArrayList<Plot>();
    for (    Plot plot : PS.get().getPlots()) {
      if (plot.getTrusted().contains(plr.getUUID()) || plot.getMembers().contains(plr.getUUID())) {
        plots.add(plot);
      }
    }
    break;
  }
case "String_Node_Str":
{
  if (!Permissions.hasPermission(plr,"String_Node_Str")) {
    MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
    return false;
  }
  if (!Permissions.hasPermission(plr,"String_Node_Str" + world)) {
    MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str" + world);
    return false;
  }
  plots=new ArrayList<>(PS.get().getPlots(world).values());
  break;
}
case "String_Node_Str":
{
if (!Permissions.hasPermission(plr,"String_Node_Str")) {
  MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
  return false;
}
plots=new ArrayList<>(PS.get().getPlots());
break;
}
case "String_Node_Str":
{
if (!Permissions.hasPermission(plr,"String_Node_Str")) {
MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
return false;
}
plots=new ArrayList<>(PS.get().getPlots());
Collections.sort(plots,new Comparator<Plot>(){
@Override public int compare(Plot p1,Plot p2){
  double v1=0;
  double v2=0;
  int p1s=p1.getSettings().ratings != null ? p1.getSettings().ratings.size() : 0;
  int p2s=p2.getSettings().ratings != null ? p2.getSettings().ratings.size() : 0;
  if (p1.getSettings().ratings != null && p1s > 0) {
    for (    Entry<UUID,Rating> entry : p1.getRatings().entrySet()) {
      double av=entry.getValue().getAverageRating();
      v1+=av * av;
    }
    v1/=p1s;
    v1+=p1s;
  }
  if (p2.getSettings().ratings != null && p2s > 0) {
    for (    Entry<UUID,Rating> entry : p2.getRatings().entrySet()) {
      double av=entry.getValue().getAverageRating();
      v2+=av * av;
    }
    v2/=p2s;
    v2+=p2s;
  }
  if (v2 == v1 && v2 != 0) {
    return p2s - p1s;
  }
  return (int)Math.signum(v2 - v1);
}
}
);
sort=false;
break;
}
case "String_Node_Str":
{
if (!Permissions.hasPermission(plr,"String_Node_Str")) {
MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
return false;
}
if (EconHandler.manager == null) {
break;
}
plots=new ArrayList<>();
for (Plot plot : PS.get().getPlots()) {
final Flag price=FlagManager.getPlotFlag(plot,"String_Node_Str");
if (price != null) {
plots.add(plot);
}
}
break;
}
case "String_Node_Str":
{
if (!Permissions.hasPermission(plr,"String_Node_Str")) {
MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
return false;
}
plots=new ArrayList<>();
for (Plot plot : PS.get().getPlots()) {
if (plot.owner == null) {
plots.add(plot);
}
}
break;
}
case "String_Node_Str":
{
if (!Permissions.hasPermission(plr,"String_Node_Str")) {
MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
return false;
}
plots=new ArrayList<>();
for (Plot plot : PS.get().getPlots()) {
if (plot.owner == null) {
continue;
}
if (UUIDHandler.getName(plot.owner) == null) {
plots.add(plot);
}
}
break;
}
default :
{
if (PS.get().isPlotWorld(args[0])) {
if (!Permissions.hasPermission(plr,"String_Node_Str")) {
MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
return false;
}
if (!Permissions.hasPermission(plr,"String_Node_Str" + args[0])) {
MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str" + args[0]);
return false;
}
plots=new ArrayList<>(PS.get().getPlots(args[0]).values());
break;
}
UUID uuid=UUIDHandler.getUUID(args[0]);
if (uuid != null) {
if (!Permissions.hasPermission(plr,"String_Node_Str")) {
MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
return false;
}
plots=new ArrayList<>(PS.get().getPlots(uuid));
break;
}
}
}
if (plots == null) {
sendMessage(plr,C.DID_YOU_MEAN,new StringComparison<String>(args[0],new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}).getBestMatch());
return false;
}
if (plots.size() == 0) {
MainUtil.sendMessage(plr,C.FOUND_NO_PLOTS);
return false;
}
displayPlots(plr,plots,12,page,world,args,sort);
return true;
}

Fixed version (ground truth):
@Override public boolean onCommand(final CommandCaller caller,final String[] args){
  final PlotPlayer plr=caller instanceof PlotPlayerCaller ? (PlotPlayer)caller.getSuperCaller() : null;
  if (args.length < 1) {
    noArgs(plr);
    return false;
  }
  int page=0;
  if (args.length > 1) {
    try {
      page=Integer.parseInt(args[1]);
      --page;
      if (page < 0) {
        page=0;
      }
    }
 catch (    final Exception e) {
      page=0;
    }
  }
  List<Plot> plots=null;
  String world;
  if (plr != null) {
    world=plr.getLocation().getWorld();
  }
 else {
    Set<String> worlds=PS.get().getPlotWorlds();
    if (worlds.size() == 0) {
      world="String_Node_Str";
    }
 else {
      world=worlds.iterator().next();
    }
  }
  String arg=args[0].toLowerCase();
  boolean sort=true;
switch (arg) {
case "String_Node_Str":
{
      if (plr == null) {
        break;
      }
      if (!Permissions.hasPermission(plr,"String_Node_Str")) {
        MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
        return false;
      }
      plots=new ArrayList<>(PS.get().getPlots(plr));
      break;
    }
case "String_Node_Str":
{
    if (plr == null) {
      break;
    }
    if (!Permissions.hasPermission(plr,"String_Node_Str")) {
      MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
      return false;
    }
    plots=new ArrayList<Plot>();
    for (    Plot plot : PS.get().getPlots()) {
      if (plot.getTrusted().contains(plr.getUUID()) || plot.getMembers().contains(plr.getUUID())) {
        plots.add(plot);
      }
    }
    break;
  }
case "String_Node_Str":
{
  if (!Permissions.hasPermission(plr,"String_Node_Str")) {
    MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
    return false;
  }
  if (!Permissions.hasPermission(plr,"String_Node_Str" + world)) {
    MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str" + world);
    return false;
  }
  plots=new ArrayList<>(PS.get().getPlots(world).values());
  break;
}
case "String_Node_Str":
{
if (!Permissions.hasPermission(plr,"String_Node_Str")) {
  MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
  return false;
}
plots=new ArrayList<>(PS.get().getPlots());
break;
}
case "String_Node_Str":
{
if (!Permissions.hasPermission(plr,"String_Node_Str")) {
MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
return false;
}
plots=new ArrayList<>(PS.get().getPlots());
Collections.sort(plots,new Comparator<Plot>(){
@Override public int compare(Plot p1,Plot p2){
  double v1=0;
  double v2=0;
  int p1s=p1.getSettings().ratings != null ? p1.getSettings().ratings.size() : 0;
  int p2s=p2.getSettings().ratings != null ? p2.getSettings().ratings.size() : 0;
  if (p1.getSettings().ratings != null && p1s > 0) {
    for (    Entry<UUID,Rating> entry : p1.getRatings().entrySet()) {
      double av=entry.getValue().getAverageRating();
      v1+=av * av;
    }
    v1/=p1s;
    v1+=p1s;
  }
  if (p2.getSettings().ratings != null && p2s > 0) {
    for (    Entry<UUID,Rating> entry : p2.getRatings().entrySet()) {
      double av=entry.getValue().getAverageRating();
      v2+=av * av;
    }
    v2/=p2s;
    v2+=p2s;
  }
  if (v2 == v1 && v2 != 0) {
    return p2s - p1s;
  }
  return (int)Math.signum(v2 - v1);
}
}
);
sort=false;
break;
}
case "String_Node_Str":
{
if (!Permissions.hasPermission(plr,"String_Node_Str")) {
MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
return false;
}
if (EconHandler.manager == null) {
break;
}
plots=new ArrayList<>();
for (Plot plot : PS.get().getPlots()) {
final Flag price=FlagManager.getPlotFlag(plot,"String_Node_Str");
if (price != null) {
plots.add(plot);
}
}
break;
}
case "String_Node_Str":
{
if (!Permissions.hasPermission(plr,"String_Node_Str")) {
MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
return false;
}
plots=new ArrayList<>();
for (Plot plot : PS.get().getPlots()) {
if (plot.owner == null) {
plots.add(plot);
}
}
break;
}
case "String_Node_Str":
{
if (!Permissions.hasPermission(plr,"String_Node_Str")) {
MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
return false;
}
plots=new ArrayList<>();
for (Plot plot : PS.get().getPlots()) {
if (plot.owner == null) {
continue;
}
if (UUIDHandler.getName(plot.owner) == null) {
plots.add(plot);
}
}
break;
}
default :
{
if (PS.get().isPlotWorld(args[0])) {
if (!Permissions.hasPermission(plr,"String_Node_Str")) {
MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
return false;
}
if (!Permissions.hasPermission(plr,"String_Node_Str" + args[0])) {
MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str" + args[0]);
return false;
}
plots=new ArrayList<>(PS.get().getPlots(args[0]).values());
break;
}
UUID uuid=UUIDHandler.getUUID(args[0],null);
if (uuid != null) {
if (!Permissions.hasPermission(plr,"String_Node_Str")) {
MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
return false;
}
plots=new ArrayList<>(PS.get().getPlots(uuid));
break;
}
}
}
if (plots == null) {
sendMessage(plr,C.DID_YOU_MEAN,new StringComparison<String>(args[0],new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}).getBestMatch());
return false;
}
if (plots.size() == 0) {
MainUtil.sendMessage(plr,C.FOUND_NO_PLOTS);
return false;
}
displayPlots(plr,plots,12,page,world,args,sort);
return true;
}