浏览代码

Removed unnecessary Field in ExpressionVisitor

kindlich 6 年前
父节点
当前提交
a782c2a145
找不到此签名对应的密钥

+ 4
- 4
JavaBytecodeCompiler/src/main/java/org/openzen/zenscript/javabytecode/compiler/JavaExpressionVisitor.java 查看文件

@@ -8,10 +8,10 @@ import org.openzen.zenscript.javabytecode.JavaMethodInfo;
8 8
 
9 9
 public class JavaExpressionVisitor implements ExpressionVisitor<Void> {
10 10
 
11
-    private final JavaStatementVisitor statementVisitor;
11
+    private JavaWriter javaWriter;
12 12
 
13
-    public JavaExpressionVisitor(JavaStatementVisitor statementVisitor) {
14
-        this.statementVisitor = statementVisitor;
13
+    public JavaExpressionVisitor(final JavaWriter javaWriter) {
14
+        this.javaWriter = javaWriter;
15 15
     }
16 16
 
17 17
     @Override
@@ -319,7 +319,7 @@ public class JavaExpressionVisitor implements ExpressionVisitor<Void> {
319 319
     }
320 320
 
321 321
     public JavaWriter getJavaWriter() {
322
-        return statementVisitor.getJavaWriter();
322
+        return javaWriter;
323 323
     }
324 324
 
325 325
 

+ 1
- 1
JavaBytecodeCompiler/src/main/java/org/openzen/zenscript/javabytecode/compiler/JavaStatementVisitor.java 查看文件

@@ -9,7 +9,7 @@ public class JavaStatementVisitor implements StatementVisitor<Void> {
9 9
     public JavaStatementVisitor(final JavaWriter javaWriter) {
10 10
 
11 11
         this.javaWriter = javaWriter;
12
-        this.expressionVisitor = new JavaExpressionVisitor( this);
12
+        this.expressionVisitor = new JavaExpressionVisitor( javaWriter);
13 13
     }
14 14
 
15 15
     @Override

正在加载...
取消
保存