Skip to content

Commit

Permalink
Fix oversight with method args and vars
Browse files Browse the repository at this point in the history
  • Loading branch information
NebelNidas committed Apr 20, 2023
1 parent 054b7f8 commit 63f33b2
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/matcher/serdes/MatchesIo.java
Original file line number Diff line number Diff line change
Expand Up @@ -480,27 +480,31 @@ private static void writeClass(ClassInstance cls, char side, Writer out) throws
private static void writeMethod(MethodInstance method, char side, Writer out) throws IOException {
writeMemberMain(method, side, out);

boolean saveUnmapped = Config.getProjectConfig().isSaveUnmappedMatches();

if (method.hasMatch()) {
for (MethodVarInstance arg : method.getArgs()) {
if (arg.hasMatch() || !arg.isMatchable()) {
if ((arg.hasMatch() || !arg.isMatchable())
&& (saveUnmapped || arg.hasMappedName())) {
writeVar(arg, 'a', out);
}
}

for (MethodVarInstance var : method.getVars()) {
if (var.hasMatch() || !var.isMatchable()) {
if ((var.hasMatch() || !var.isMatchable())
&& (saveUnmapped || var.hasMappedName())) {
writeVar(var, 'a', out);
}
}

for (MethodVarInstance arg : method.getMatch().getArgs()) {
if (!arg.isMatchable()) {
if (!arg.isMatchable() && (saveUnmapped || arg.hasMappedName())) {
writeVar(arg, 'b', out);
}
}

for (MethodVarInstance var : method.getMatch().getVars()) {
if (!var.isMatchable()) {
if (!var.isMatchable() && (saveUnmapped || var.hasMappedName())) {
writeVar(var, 'b', out);
}
}
Expand Down

0 comments on commit 63f33b2

Please sign in to comment.