toString added

Don't remove public static final modifier in interface
getClassAnalyzer added


git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@924 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent f112e62f46
commit 2d4264eb5b
  1. 26
      jode/jode/decompiler/FieldAnalyzer.java

@ -65,6 +65,10 @@ public class FieldAnalyzer implements Analyzer {
return type; return type;
} }
public ClassAnalyzer getClassAnalyzer() {
return clazz;
}
public Expression getConstant() { public Expression getConstant() {
return constant; return constant;
} }
@ -85,7 +89,11 @@ public class FieldAnalyzer implements Analyzer {
if (constant != null) if (constant != null)
return constant.equals(expr); return constant.equals(expr);
if (isSynthetic && isFinal() /* This should check for isFinal(), but sadly, sometimes jikes
* doesn't make a val$ field final. I don't know when, or why,
* so I currently ignore isFinal.
*/
if (isSynthetic
&& (fieldName.startsWith("this$") && (fieldName.startsWith("this$")
|| fieldName.startsWith("val$"))) { || fieldName.startsWith("val$"))) {
if (fieldName.startsWith("val$") && fieldName.length() > 4 if (fieldName.startsWith("val$") && fieldName.length() > 4
@ -143,11 +151,15 @@ public class FieldAnalyzer implements Analyzer {
* implicitly public, static, and final. It is permitted, but * implicitly public, static, and final. It is permitted, but
* strongly discouraged as a matter of style, to redundantly * strongly discouraged as a matter of style, to redundantly
* specify any or all of these modifiers for such fields. * specify any or all of these modifiers for such fields.
*
* But I personally don't like this style..., move the
* comment mark if you think different.
if (clazz.getClazz().isInterface())
modifiedModifiers &= ~(Modifier.PUBLIC
| Modifier.STATIC
| Modifier.FINAL);
*/ */
if (clazz.getClazz().isInterface())
modifiedModifiers &= ~(Modifier.PUBLIC
| Modifier.STATIC
| Modifier.FINAL);
String modif = Modifier.toString(modifiedModifiers); String modif = Modifier.toString(modifiedModifiers);
if (modif.length() > 0) if (modif.length() > 0)
writer.print(modif+" "); writer.print(modif+" ");
@ -160,5 +172,9 @@ public class FieldAnalyzer implements Analyzer {
} }
writer.println(";"); writer.println(";");
} }
public String toString() {
return getClass().getName()+"["+clazz.getClazz()+"."+getName()+"]";
}
} }

Loading…
Cancel
Save