Program: 83585
Project: 83585
Buggy source:
public void RentRank(Player player,String rankname){
  DebugPrint("String_Node_Str" + rankname);
  for (  Rank r : Ranks.keySet()) {
    DebugPrint("String_Node_Str" + rankname + "String_Node_Str"+ r.name);
    if (r.name.equalsIgnoreCase(rankname)) {
      DebugPrint(rankname + "String_Node_Str" + r.rentCost);
      if (r.rentCost >= 0) {
        if (r.rentCost == 0) {
          DebugPrint(rankname + "String_Node_Str");
          if (Method.getAccount(player.getName()).hasEnough(r.rentAmount)) {
            DebugPrint("String_Node_Str");
switch (PromotePlayer(player,r)) {
case 0:
              Method.getAccount(player.getName()).subtract(r.rentAmount);
            RentedRanks.add(new PurchasedRank(player.getName(),r));
          Map<String,String> replace=new HashMap<String,String>();
        replace.putAll(ProcessMsgVars(player));
      replace.putAll(ProcessMsgVars(r));
    String msg=ProcessMsg(r.rentGainedMsg,replace);
  if (r.broadcast)   getServer().broadcastMessage(msg);
 else   player.sendMessage(msg);
break;
case 1:
player.sendMessage("String_Node_Str" + r.GetOldGroup().getName() + "String_Node_Str"+ r.name);
break;
case 2:
player.sendMessage("String_Node_Str" + r.GetGroup().getName() + "String_Node_Str"+ r.name+ "String_Node_Str");
break;
}
}
 else {
player.sendMessage("String_Node_Str" + Method.format(r.rentAmount));
}
}
 else {
DebugPrint(rankname + "String_Node_Str" + r.rentCost+ "String_Node_Str");
ItemStack item=new ItemStack(r.rentCost,(int)r.rentAmount);
if (CheckItems(player,item)) {
DebugPrint("String_Node_Str");
switch (PromotePlayer(player,r)) {
case 0:
ConsumeItems(player,item);
Map<String,String> replace=new HashMap<String,String>();
replace.putAll(ProcessMsgVars(player));
replace.putAll(ProcessMsgVars(r));
String msg=ProcessMsg(r.rentGainedMsg,replace);
if (r.broadcast) getServer().broadcastMessage(msg);
 else player.sendMessage(msg);
break;
case 1:
player.sendMessage("String_Node_Str" + r.GetOldGroup().getName() + "String_Node_Str"+ r.name);
break;
case 2:
player.sendMessage("String_Node_Str" + r.GetGroup() + "String_Node_Str"+ r.name+ "String_Node_Str");
break;
}
}
 else {
player.sendMessage("String_Node_Str" + r.rentAmount + "String_Node_Str"+ Material.getMaterial(r.rentCost));
}
}
}
}
}
}

Fixed version (ground truth):
public void RentRank(Player player,String rankname){
  DebugPrint("String_Node_Str" + rankname);
  for (  Rank r : Ranks.keySet()) {
    DebugPrint("String_Node_Str" + rankname + "String_Node_Str"+ r.name);
    if (r.name.equalsIgnoreCase(rankname)) {
      DebugPrint(rankname + "String_Node_Str" + r.rentCost);
      if (r.rentCost >= 0) {
        if (r.rentCost == 0) {
          DebugPrint(rankname + "String_Node_Str");
          if (Method.getAccount(player.getName()).hasEnough(r.rentAmount)) {
            DebugPrint("String_Node_Str");
switch (PromotePlayer(player,r)) {
case 0:
              Method.getAccount(player.getName()).subtract(r.rentAmount);
            RentedRanks.add(new PurchasedRank(player.getName(),r));
          Map<String,String> replace=new HashMap<String,String>();
        replace.putAll(ProcessMsgVars(player));
      replace.putAll(ProcessMsgVars(r));
    String msg=ProcessMsg(r.rentGainedMsg,replace);
  if (r.broadcast)   getServer().broadcastMessage(msg);
 else   player.sendMessage(msg);
break;
case 1:
player.sendMessage("String_Node_Str" + r.GetOldGroup().getName() + "String_Node_Str"+ r.name);
break;
case 2:
player.sendMessage("String_Node_Str" + r.GetGroup().getName() + "String_Node_Str"+ r.name+ "String_Node_Str");
break;
}
}
 else {
player.sendMessage("String_Node_Str" + Method.format(r.rentAmount));
}
}
 else {
DebugPrint(rankname + "String_Node_Str" + r.rentCost+ "String_Node_Str");
ItemStack item=new ItemStack(r.rentCost,(int)r.rentAmount);
if (CheckItems(player,item)) {
DebugPrint("String_Node_Str");
switch (PromotePlayer(player,r)) {
case 0:
ConsumeItems(player,item);
Map<String,String> replace=new HashMap<String,String>();
replace.putAll(ProcessMsgVars(player));
replace.putAll(ProcessMsgVars(r));
String msg=ProcessMsg(r.rentGainedMsg,replace);
if (r.broadcast) getServer().broadcastMessage(msg);
 else player.sendMessage(msg);
break;
case 1:
player.sendMessage("String_Node_Str" + r.GetOldGroup().getName() + "String_Node_Str"+ r.name);
break;
case 2:
player.sendMessage("String_Node_Str" + r.GetGroup() + "String_Node_Str"+ r.name+ "String_Node_Str");
break;
}
}
 else {
player.sendMessage("String_Node_Str" + r.rentAmount + "String_Node_Str"+ Material.getMaterial(r.rentCost));
}
}
}
}
}
saveRent();
}