remove unnecessary casts in simplify() [I'm not sure yet, if this is

really correct]


git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@927 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 25 years ago
parent ab0468ef41
commit f02a601510
  1. 10
      jode/jode/expr/CheckCastOperator.java

@ -41,6 +41,16 @@ public class CheckCastOperator extends Operator {
public void updateType() {
}
public Expression simplify() {
if (subExpressions[0].getType().getCanonic()
.isOfType(Type.tSubType(castType)))
/* This is an unnecessary widening cast, probably that inserted
* by jikes for inner classes constructors.
*/
return subExpressions[0].simplify();
return super.simplify();
}
public void dumpExpression(TabbedPrintWriter writer)
throws java.io.IOException {
writer.print("(");

Loading…
Cancel
Save