Skip to content

Commit

Permalink
Add the index to the param renamer, needed for sane param name genera…
Browse files Browse the repository at this point in the history
…tion..
  • Loading branch information
cpw committed Nov 8, 2015
1 parent da7239d commit ba604f3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/org/jetbrains/java/decompiler/main/ClassWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public IVariableNameProvider createFactory(StructMethod method) {
}

@Override
public String renameAbstractParameter(String abstractParam) {
public String renameAbstractParameter(String abstractParam, int index) {
return abstractParam;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@

public interface IVariableNameProvider {
public Map<VarVersionPair,String> rename(Map<VarVersionPair,String> variables);
public String renameAbstractParameter(String abstractParam);
public String renameAbstractParameter(String abstractParam, int index);
public void addParentContext(IVariableNameProvider renamer);
}
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ else if (remap.containsKey(type))
}

@Override
public String renameAbstractParameter(String abstractParam) {
public String renameAbstractParameter(String abstractParam, int index) {
return abstractParam;
}

Expand Down

0 comments on commit ba604f3

Please sign in to comment.