我想調試代碼的一部分,但有一個「重複的局部變量」錯誤。我將如何解決這個問題?我不確定錯誤是什麼,所以我在這裏問。重複的局部變量「附加」錯誤?
public JumpPlusPlayer(JumpPlus plugin, Player p) {
loadPermissions(p, plugin);
fillConfig(plugin);
}
protected void loadPermissions(Player p, JumpPlus plugin) {
HashSet<PermissionAttachmentInfo> perms = new HashSet<PermissionAttachmentInfo>();
PermissionAttachment attach;
if (plugin.usingPEX) {
PermissionUser user = PermissionsEx.getUser(p);
String world = p.getWorld().getName();
attach = new PermissionAttachment(plugin, p);
for (String perm : user.getPermissions(world)) {
String expression = user.getMatchingExpression(perm, world);
perms.add(new PermissionAttachmentInfo(p, perm, attach, user.explainExpression(expression)));
}
} else {
perms = (HashSet<PermissionAttachmentInfo>) p.getEffectivePermissions();
}
for (PermissionAttachmentInfo attach : perms) {
String perm = attach.getPermission();
if (perm.contains("jumpplus.config.")) {
String[] aux = perm.split("jumpplus.config.");
aux = aux[1].split("-");
if (aux[0].equals("hspeed"))
this.hSpeed = Double.valueOf(Double.parseDouble(aux[1]));
else if (aux[0].equals("vspeed"))
this.vSpeed = Double.valueOf(Double.parseDouble(aux[1]));
else if (aux[0].equals("maxjumps"))
this.maxJumps = Integer.valueOf(Integer.parseInt(aux[1]));
else if (aux[0].equals("maxfreejumps"))
this.maxFreeJumps = Integer.valueOf(Integer.parseInt(aux[1]));
else if (aux[0].equals("jumpcost"))
this.jumpCost = Integer.valueOf(Integer.parseInt(aux[1]));
else if (aux[0].equals("fallmodifier"))
this.fallModifier = Integer.valueOf(Integer.parseInt(aux[1]));
else if (aux[0].equals("particleeffect"))
this.particleEffect = Boolean.valueOf(Boolean.parseBoolean(aux[1]));
else if (aux[0].equals("defaultstate"))
this.enable = Boolean.valueOf(Boolean.parseBoolean(aux[1]));
}
}
}
粘貼這裏錯誤的堆棧跟蹤,顯示它的代碼行。 – 2013-02-28 09:38:11
體面的IDE可以幫助你(http://www.eclipse.org/downloads/) – Apurv 2013-02-28 09:38:46
@defaultlocale這是一個編譯錯誤,所以不會有堆棧跟蹤。 – 2013-02-28 09:41:14