private CatchAllStatement(Statement head, Statement handler) : this() { first = head; stats.AddWithKey(head, head.id); this.handler = handler; stats.AddWithKey(handler, handler.id); List <StatEdge> lstSuccs = head.GetSuccessorEdges(Statedge_Direct_All); if (!(lstSuccs.Count == 0)) { StatEdge edge = lstSuccs[0]; if (edge.GetType() == StatEdge.Type_Regular) { post = edge.GetDestination(); } } vars.Add(new VarExprent(DecompilerContext.GetCounterContainer().GetCounterAndIncrement (CounterContainer.Var_Counter), new VarType(ICodeConstants.Type_Object, 0, "java/lang/Throwable" ), DecompilerContext.GetVarProcessor())); }
private CatchStatement(Statement head, Statement next, HashSet <Statement> setHandlers ) : this() { first = head; stats.AddWithKey(first, first.id); foreach (StatEdge edge in head.GetSuccessorEdges(StatEdge.Type_Exception)) { Statement stat = edge.GetDestination(); if (setHandlers.Contains(stat)) { stats.AddWithKey(stat, stat.id); exctstrings.Add(new List <string>(edge.GetExceptions())); vars.Add(new VarExprent(DecompilerContext.GetCounterContainer().GetCounterAndIncrement (CounterContainer.Var_Counter), new VarType(ICodeConstants.Type_Object, 0, edge. GetExceptions()[0]), DecompilerContext.GetVarProcessor())); } } // FIXME: for now simply the first type. Should get the first common superclass when possible. if (next != null) { post = next; } }
public override Statement GetSimpleCopy() { CatchAllStatement cas = new CatchAllStatement(); cas.isFinally__ = this.isFinally__; if (this.monitor != null) { cas.monitor = new VarExprent(DecompilerContext.GetCounterContainer().GetCounterAndIncrement (CounterContainer.Var_Counter), VarType.Vartype_Int, DecompilerContext.GetVarProcessor ()); } if (!(this.vars.Count == 0)) { cas.vars.Add(new VarExprent(DecompilerContext.GetCounterContainer().GetCounterAndIncrement (CounterContainer.Var_Counter), new VarType(ICodeConstants.Type_Object, 0, "java/lang/Throwable" ), DecompilerContext.GetVarProcessor())); } return(cas); }
public override Statement GetSimpleCopy() { CatchStatement cs = new CatchStatement(); foreach (List <string> exc in this.exctstrings) { cs.exctstrings.Add(new List <string>(exc)); cs.vars.Add(new VarExprent(DecompilerContext.GetCounterContainer().GetCounterAndIncrement (CounterContainer.Var_Counter), new VarType(ICodeConstants.Type_Object, 0, exc[0 ]), DecompilerContext.GetVarProcessor())); } return(cs); }