Skip to content

Commit

Permalink
Fix issue with constructor
Browse files Browse the repository at this point in the history
Constructor with reserve Java name not work, reserved work is suffix with param, but when name is evaluated, value as _ as prefix. 

Exemple : 
this.interface = _interfaceParam;
  • Loading branch information
GeVa2072 authored Jul 4, 2024
1 parent 283a5cf commit 19ee9dc
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -494,8 +494,8 @@ public static class MemberOrArgument {
private final List<String> annotations = new ArrayList<>();

public MemberOrArgument(String _name, String _type, boolean _finalMember) {
// repair reserved words by adding 'Param' as appendix
name = IdentifierMangler.isReservedWord(_name) ? _name + "param" : _name;
// repair reserved words by adding 'Param' as appendix, and when start with _ too
name = (IdentifierMangler.isReservedWord(_name) || IdentifierMangler.isReservedWord(_name.replaceFirst("^_(.+)", "$1"))) ? _name + "param" : _name;
type = _type;
finalArg = _finalMember;
}
Expand Down

0 comments on commit 19ee9dc

Please sign in to comment.