MCPcopy Create free account
hub / github.com/FabricMC/Matcher / writeMethod

Method writeMethod

src/main/java/matcher/serdes/MatchesIo.java:481–513  ·  view source on GitHub ↗
(MethodInstance method, char side, Writer out)

Source from the content-addressed store, hash-verified

479 }
480
481 private static void writeMethod(MethodInstance method, char side, Writer out) throws IOException {
482 writeMemberMain(method, side, out);
483
484 boolean saveUnmapped = Config.getProjectConfig().isSaveUnmappedMatches();
485
486 if (method.hasMatch()) {
487 for (MethodVarInstance arg : method.getArgs()) {
488 if ((arg.hasMatch() || !arg.isMatchable())
489 && (saveUnmapped || arg.hasMappedName())) {
490 writeVar(arg, 'a', out);
491 }
492 }
493
494 for (MethodVarInstance var : method.getVars()) {
495 if ((var.hasMatch() || !var.isMatchable())
496 && (saveUnmapped || var.hasMappedName())) {
497 writeVar(var, 'a', out);
498 }
499 }
500
501 for (MethodVarInstance arg : method.getMatch().getArgs()) {
502 if (!arg.isMatchable() && (saveUnmapped || arg.hasMappedName())) {
503 writeVar(arg, 'b', out);
504 }
505 }
506
507 for (MethodVarInstance var : method.getMatch().getVars()) {
508 if (!var.isMatchable() && (saveUnmapped || var.hasMappedName())) {
509 writeVar(var, 'b', out);
510 }
511 }
512 }
513 }
514
515 private static void writeMemberMain(MemberInstance<?> member, char side, Writer out) throws IOException {
516 out.write('\t');

Callers 1

writeClassMethod · 0.95

Calls 10

writeMemberMainMethod · 0.95
getProjectConfigMethod · 0.95
writeVarMethod · 0.95
isSaveUnmappedMatchesMethod · 0.80
hasMatchMethod · 0.80
getVarsMethod · 0.80
isMatchableMethod · 0.65
hasMappedNameMethod · 0.65
getMatchMethod · 0.65
getArgsMethod · 0.45

Tested by

no test coverage detected