From 87da45e2796d5c59bdc1a0ead0370f9b8c62c022 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 28 Apr 1999 18:09:40 +0000 Subject: [PATCH] deprecated dumpExpression git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@703 379699f6-c40d-0410-875b-85095c16579e --- jode/jode/decompiler/FieldAnalyzer.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/jode/jode/decompiler/FieldAnalyzer.java b/jode/jode/decompiler/FieldAnalyzer.java index 994583e..3067d7c 100644 --- a/jode/jode/decompiler/FieldAnalyzer.java +++ b/jode/jode/decompiler/FieldAnalyzer.java @@ -32,6 +32,7 @@ public class FieldAnalyzer implements Analyzer { String fieldName; Expression constant; boolean isSynthetic; + boolean isDeprecated; boolean analyzedSynthetic = false; public FieldAnalyzer(ClassAnalyzer cla, FieldInfo fd, @@ -45,6 +46,7 @@ public class FieldAnalyzer implements Analyzer { fieldName = fd.getName(); constant = null; this.isSynthetic = fd.isSynthetic(); + this.isDeprecated = fd.isDeprecated(); if (fd.getConstant() != null) { constant = new ConstOperator(fd.getConstant()); constant.setType(type); @@ -78,6 +80,8 @@ public class FieldAnalyzer implements Analyzer { public void analyze() { imports.useType(type); + if (constant != null) + constant = constant.simplify(); } public void dumpSource(TabbedPrintWriter writer) @@ -85,6 +89,11 @@ public class FieldAnalyzer implements Analyzer { { if (analyzedSynthetic) return; /*XXX*/ + if (isDeprecated) { + writer.println("/**"); + writer.println(" * @deprecated"); + writer.println(" */"); + } if (isSynthetic) writer.print("/*synthetic*/ "); String modif = Modifier.toString(modifiers); @@ -94,8 +103,10 @@ public class FieldAnalyzer implements Analyzer { writer.printType(type); writer.print(" " + fieldName); if (constant != null) { - writer.print(" = " + constant.simplify().toString()); + writer.print(" = "); + constant.dumpExpression(writer); } writer.println(";"); } } +