From 3523ea6b64c7ea02c399e2e1d9f02d96704617b8 Mon Sep 17 00:00:00 2001 From: jochen Date: Sat, 26 Jun 1999 16:16:55 +0000 Subject: [PATCH] CodeAnalyzer merged into MethodAnalyzer git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@909 379699f6-c40d-0410-875b-85095c16579e --- jode/jode/expr/PutFieldOperator.java | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/jode/jode/expr/PutFieldOperator.java b/jode/jode/expr/PutFieldOperator.java index a72c590..01a24fb 100644 --- a/jode/jode/expr/PutFieldOperator.java +++ b/jode/jode/expr/PutFieldOperator.java @@ -21,26 +21,26 @@ package jode.expr; import jode.type.Type; import jode.type.NullType; import jode.bytecode.Reference; -import jode.decompiler.CodeAnalyzer; +import jode.decompiler.MethodAnalyzer; import jode.decompiler.FieldAnalyzer; import jode.decompiler.TabbedPrintWriter; import jode.decompiler.Scope; public class PutFieldOperator extends LValueExpression { - CodeAnalyzer codeAnalyzer; + MethodAnalyzer methodAnalyzer; boolean staticFlag; Reference ref; Type classType; - public PutFieldOperator(CodeAnalyzer codeAnalyzer, boolean staticFlag, + public PutFieldOperator(MethodAnalyzer methodAnalyzer, boolean staticFlag, Reference ref) { super(Type.tType(ref.getType())); - this.codeAnalyzer = codeAnalyzer; + this.methodAnalyzer = methodAnalyzer; this.staticFlag = staticFlag; this.ref = ref; this.classType = Type.tType(ref.getClazz()); if (staticFlag) - codeAnalyzer.useType(classType); + methodAnalyzer.useType(classType); initOperands(staticFlag ? 0 : 1); } @@ -54,13 +54,13 @@ public class PutFieldOperator extends LValueExpression { * allow super class */ public boolean isThis() { - return (classType.equals(Type.tClass(codeAnalyzer.getClazz()))); + return (classType.equals(Type.tClass(methodAnalyzer.getClazz()))); } public FieldAnalyzer getField() { if (!isThis()) return null; - return codeAnalyzer.getClassAnalyzer() + return methodAnalyzer.getClassAnalyzer() .getField(ref.getName(), Type.tType(ref.getType())); } @@ -96,16 +96,17 @@ public class PutFieldOperator extends LValueExpression { && subExpressions[0] instanceof ThisOperator; String fieldName = ref.getName(); if (staticFlag) { - if (!classType.equals(Type.tClass(codeAnalyzer.getClazz())) - || codeAnalyzer.findLocal(fieldName) != null) { + if (!classType.equals(Type.tClass(methodAnalyzer.getClazz())) + || methodAnalyzer.findLocal(fieldName) != null) { writer.printType(classType); writer.print("."); } writer.print(fieldName); - } else if (subExpressions[0].getType() instanceof NullType) { + } else if (subExpressions[0].getType().getCanonic() + instanceof NullType) { writer.print("(("); writer.printType(classType); - writer.print(")"); + writer.print(") "); subExpressions[0].dumpExpression(writer, 700); writer.print(")."); writer.print(fieldName);