isSynthetic

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@261 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent 6c3b630017
commit b3dd25231c
  1. 9
      jode/jode/decompiler/FieldAnalyzer.java

@ -33,6 +33,7 @@ public class FieldAnalyzer implements Analyzer {
Type type; Type type;
String fieldName; String fieldName;
Expression constant; Expression constant;
boolean isSynthetic;
public FieldAnalyzer(ClassAnalyzer cla, FieldInfo fd, public FieldAnalyzer(ClassAnalyzer cla, FieldInfo fd,
JodeEnvironment e) JodeEnvironment e)
@ -44,6 +45,7 @@ public class FieldAnalyzer implements Analyzer {
type = fd.getType(); type = fd.getType();
fieldName = fd.getName(); fieldName = fd.getName();
constant = null; constant = null;
this.isSynthetic = (fd.findAttribute("Synthetic") != null);
AttributeInfo attribute = fd.findAttribute("ConstantValue"); AttributeInfo attribute = fd.findAttribute("ConstantValue");
@ -74,6 +76,10 @@ public class FieldAnalyzer implements Analyzer {
return type; return type;
} }
public boolean isSynthetic() {
return isSynthetic;
}
public boolean setInitializer(Expression expr) { public boolean setInitializer(Expression expr) {
expr.makeInitializer(); expr.makeInitializer();
if (constant != null) if (constant != null)
@ -89,6 +95,8 @@ public class FieldAnalyzer implements Analyzer {
public void dumpSource(TabbedPrintWriter writer) public void dumpSource(TabbedPrintWriter writer)
throws java.io.IOException throws java.io.IOException
{ {
if (isSynthetic)
return; /*XXX*/
String modif = Modifier.toString(modifiers); String modif = Modifier.toString(modifiers);
if (modif.length() > 0) if (modif.length() > 0)
writer.print(modif+" "); writer.print(modif+" ");
@ -100,3 +108,4 @@ public class FieldAnalyzer implements Analyzer {
writer.println(";"); writer.println(";");
} }
} }

Loading…
Cancel
Save