diff --git a/src/main/java/org/cadixdev/mercury/remapper/RemapperVisitor.java b/src/main/java/org/cadixdev/mercury/remapper/RemapperVisitor.java index 6f88aff..d59f025 100644 --- a/src/main/java/org/cadixdev/mercury/remapper/RemapperVisitor.java +++ b/src/main/java/org/cadixdev/mercury/remapper/RemapperVisitor.java @@ -120,14 +120,16 @@ private void remapType(SimpleName node, ITypeBinding binding) { } String qualifiedName = (mapping != null ? mapping.getFullDeobfuscatedName().replace('/', '.') : binding.getBinaryName()).replace('$', '.'); - String newName = this.importRewrite.addImport(qualifiedName, this.importStack.peek()); - if (!node.getIdentifier().equals(newName) && !node.isVar()) { - if (newName.indexOf('.') == -1) { - this.context.createASTRewrite().set(node, SimpleName.IDENTIFIER_PROPERTY, newName, null); - } else { - // Qualified name - this.context.createASTRewrite().replace(node, node.getAST().newName(newName), null); + if(!node.isVar()) { + String newName = this.importRewrite.addImport(qualifiedName, this.importStack.peek()); + if(!node.getIdentifier().equals(newName)) { + if(newName.indexOf('.') == -1) { + this.context.createASTRewrite().set(node, SimpleName.IDENTIFIER_PROPERTY, newName, null); + } else { + // Qualified name + this.context.createASTRewrite().replace(node, node.getAST().newName(newName), null); + } } } }