From 93fc67542d8a76bb9f94adc71f40034e01039b10 Mon Sep 17 00:00:00 2001 From: Jonas Herzig Date: Thu, 25 Apr 2019 20:46:27 +0200 Subject: Fix lombok annotations being replaced if their AST is remapped E.g. @Getter private Minecraft mc; incorrectly remapped to @MinecraftClient private MinecraftClient mc; --- src/main/java/com/replaymod/gradle/remap/Transformer.java | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/main') diff --git a/src/main/java/com/replaymod/gradle/remap/Transformer.java b/src/main/java/com/replaymod/gradle/remap/Transformer.java index c151b7d..d6ce2f2 100644 --- a/src/main/java/com/replaymod/gradle/remap/Transformer.java +++ b/src/main/java/com/replaymod/gradle/remap/Transformer.java @@ -185,6 +185,15 @@ class Transformer { } return true; } + + @Override + public boolean visit(MethodDeclaration node) { + if (node.getBody() != null && node.getLength() == node.getBody().getLength()) { + // Body exists but is same length as overall definition? -> method was probably generated by lombok + return false; + } + return super.visit(node); + } }); return changed.get(); } -- cgit