Fix duplicate comments about transitive access wideners. Fixes #544

A more sophisticated fix might be nice, but im not sure it will provide a lot of benefit.
This commit is contained in:
modmuss50 2021-11-25 18:53:04 +00:00
parent 7b28d61fab
commit 60c908ea1b

View file

@ -139,7 +139,12 @@ public final class TransitiveAccessWidenerMappingsProcessor {
comment += "\n";
}
comment += "Access widened by %s to %s".formatted(modId(), access);
String awComment = "Access widened by %s to %s".formatted(modId(), access);
if (!comment.contains(awComment)) {
// Ensure we don't comment the same thing twice. A bit of a cheap way to do this, but should work ok.
comment += awComment;
}
return comment;
}