From ba604f35f4e1abbba5a893c3eb031fb3c6720ebd Mon Sep 17 00:00:00 2001 From: cpw Date: Sun, 8 Nov 2015 13:28:24 -0500 Subject: [PATCH] Add the index to the param renamer, needed for sane param name generation.. --- src/org/jetbrains/java/decompiler/main/ClassWriter.java | 2 +- .../jetbrains/java/decompiler/main/IdentityRenamerFactory.java | 2 +- .../java/decompiler/main/extern/IVariableNameProvider.java | 2 +- src/org/jetbrains/java/decompiler/util/JADNameProvider.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/org/jetbrains/java/decompiler/main/ClassWriter.java b/src/org/jetbrains/java/decompiler/main/ClassWriter.java index 1338a42..25d01e3 100644 --- a/src/org/jetbrains/java/decompiler/main/ClassWriter.java +++ b/src/org/jetbrains/java/decompiler/main/ClassWriter.java @@ -731,7 +731,7 @@ else if (CodeConstants.CLINIT_NAME.equals(name)) { buffer.append(' '); String parameterName = methodWrapper.varproc.getVarName(new VarVersionPair(index, 0)); if ((flags & (CodeConstants.ACC_ABSTRACT | CodeConstants.ACC_NATIVE)) != 0) { - parameterName = methodWrapper.methodStruct.renamer.renameAbstractParameter(parameterName); + parameterName = methodWrapper.methodStruct.renamer.renameAbstractParameter(parameterName, index); } buffer.append(parameterName == null ? "param" + index : parameterName); // null iff decompiled with errors diff --git a/src/org/jetbrains/java/decompiler/main/IdentityRenamerFactory.java b/src/org/jetbrains/java/decompiler/main/IdentityRenamerFactory.java index bc29407..e8c3340 100644 --- a/src/org/jetbrains/java/decompiler/main/IdentityRenamerFactory.java +++ b/src/org/jetbrains/java/decompiler/main/IdentityRenamerFactory.java @@ -14,7 +14,7 @@ public IVariableNameProvider createFactory(StructMethod method) { } @Override - public String renameAbstractParameter(String abstractParam) { + public String renameAbstractParameter(String abstractParam, int index) { return abstractParam; } diff --git a/src/org/jetbrains/java/decompiler/main/extern/IVariableNameProvider.java b/src/org/jetbrains/java/decompiler/main/extern/IVariableNameProvider.java index 9d6b1a5..26f1071 100644 --- a/src/org/jetbrains/java/decompiler/main/extern/IVariableNameProvider.java +++ b/src/org/jetbrains/java/decompiler/main/extern/IVariableNameProvider.java @@ -6,6 +6,6 @@ public interface IVariableNameProvider { public Map rename(Map variables); - public String renameAbstractParameter(String abstractParam); + public String renameAbstractParameter(String abstractParam, int index); public void addParentContext(IVariableNameProvider renamer); } diff --git a/src/org/jetbrains/java/decompiler/util/JADNameProvider.java b/src/org/jetbrains/java/decompiler/util/JADNameProvider.java index f2d2e3b..b588cec 100644 --- a/src/org/jetbrains/java/decompiler/util/JADNameProvider.java +++ b/src/org/jetbrains/java/decompiler/util/JADNameProvider.java @@ -179,7 +179,7 @@ else if (remap.containsKey(type)) } @Override - public String renameAbstractParameter(String abstractParam) { + public String renameAbstractParameter(String abstractParam, int index) { return abstractParam; }