From 5efa30a2a1003017f63bc71a334fea2fef423961 Mon Sep 17 00:00:00 2001 From: xiaoma20082008 <761910756@qq.com> Date: Tue, 14 Sep 2021 16:52:31 +0800 Subject: [PATCH] : remove ASTReference impl in CompiledVisitor --- .../templates/CompiledVisitor.java | 21 +------------------ 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/velocity-engine-core/src/main/java/org/apache/velocity/spi/translators/templates/CompiledVisitor.java b/velocity-engine-core/src/main/java/org/apache/velocity/spi/translators/templates/CompiledVisitor.java index 7b3209ba5..ce35f724f 100644 --- a/velocity-engine-core/src/main/java/org/apache/velocity/spi/translators/templates/CompiledVisitor.java +++ b/velocity-engine-core/src/main/java/org/apache/velocity/spi/translators/templates/CompiledVisitor.java @@ -153,26 +153,7 @@ public String visit(ASTReference node, Object data) { // 1. Variables // 2. Properties // 3. Methods - String s; - if (node.getFirstToken().equals(node.getLastToken())) { - s = node.getFirstToken().image.substring(1); - } else { - s = node.getFirstToken().image; - for (Token t = node.getFirstToken().next; t != node.getLastToken(); t = t.next) { - if (StringUtils.isNotBlank(t.image)) { - s = t.image; - break; - } - } - } - if (node.jjtGetParent() instanceof ASTprocess) { - // 最外层直接输出 - s = " $output.write($context.get(\"" + s + "\"));\r\n"; - } else { - // 其它命令包含的 - s = "$context.get(\"" + s + "\")"; - } - return s; + return null; } @Override