diff options
author | Jonas Herzig <me@johni0702.de> | 2019-04-25 20:46:27 +0200 |
---|---|---|
committer | Jonas Herzig <me@johni0702.de> | 2019-04-25 20:46:27 +0200 |
commit | 93fc67542d8a76bb9f94adc71f40034e01039b10 (patch) | |
tree | e86f71116eefa59328ae44ee94b7eefc10071f7e /src/main/java/com/replaymod/gradle | |
parent | 5fba27c5313046ab5c9ccdefeb94a81b292ef8d4 (diff) | |
download | Remap-93fc67542d8a76bb9f94adc71f40034e01039b10.tar.gz Remap-93fc67542d8a76bb9f94adc71f40034e01039b10.tar.bz2 Remap-93fc67542d8a76bb9f94adc71f40034e01039b10.zip |
Fix lombok annotations being replaced if their AST is remapped
E.g.
@Getter
private Minecraft mc;
incorrectly remapped to
@MinecraftClient
private MinecraftClient mc;
Diffstat (limited to 'src/main/java/com/replaymod/gradle')
-rw-r--r-- | src/main/java/com/replaymod/gradle/remap/Transformer.java | 9 |
1 files changed, 9 insertions, 0 deletions
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(); } |