<div dir="ltr">Hello <span style="color:rgb(0,0,0)">everybody!</span><div><font color="#000000"><br></font><div><span style="color:rgb(0,0,0)">I try to do test transformation, but I have some problems ... </span></div></div><div><font color="#000000">Code:</font></div><div><font color="#000000"><br></font></div><div><font color="#000000"><div>        Chain units = b.getUnits();</div></font><div><font color="#000000">        </font></div><div><font color="#000000">        Iterator stmtIt = units.snapshotIterator();</font></div><div><font color="#000000">        while(stmtIt.hasNext())</font></div><div><font color="#000000">        {</font></div><div><font color="#000000">            Stmt stmt = (Stmt)stmtIt.next();</font></div><div><font color="#000000">            if(stmt instanceof EnterMonitorStmt)</font></div><div><font color="#000000">            {</font></div><div><font color="#000000">                Local intLocal = Jimple.v().newLocal(&quot;myInt&quot;, IntType.v());</font></div><div><font color="#000000">                b.getLocals().add(intLocal);</font></div><div><font color="#000000">                AssignStmt as1 = Jimple.v().newAssignStmt(intLocal, IntConstant.v(500));</font></div><div><font color="#000000">                units.insertBefore(as1, stmt);</font></div><div><font color="#000000">                AssignStmt as2 = Jimple.v().newAssignStmt(intLocal, Jimple.v().newAddExpr(intLocal, IntConstant.v(500)));</font></div><div><font color="#000000">                units.insertAfter(as2, stmt);</font></div><div><font color="#000000">                Local tmpRef = Jimple.v().newLocal(&quot;tmpRef&quot;, RefType.v(&quot;java.io.PrintStream&quot;));</font></div><div><font color="#000000">                AssignStmt as3 = Jimple.v().newAssignStmt(tmpRef, </font></div><div><font color="#000000">                        Jimple.v().newStaticFieldRef(Scene.v().getField(&quot;&lt;java.lang.System: java.io.PrintStream out&gt;&quot;).makeRef()));</font></div><div><font color="#000000">                units.insertAfter(as3, stmt);</font></div><div><font color="#000000">                SootMethod toCall = Scene.v().getMethod(&quot;&lt;java.io.PrintStream: void println(int)&gt;&quot;);</font></div><div><font color="#000000">                </font></div><div><font color="#000000">                units.insertAfter(Jimple.v().newInvokeStmt(Jimple.v().newVirtualInvokeExpr(tmpRef, toCall.makeRef(), intLocal)), as3);</font></div><div><font color="#000000">            }</font></div><div><font color="#000000">        }</font></div></div><div><span style="color:rgb(0,0,0)"><br></span></div><div><span style="color:rgb(0,0,0)">What&#39;s wrong? Could someone explain, why this code isn&#39;t work?</span></div><div><span style="color:rgb(0,0,0)">Thanks for any help.</span></div><div><span style="color:rgb(0,0,0)"><br></span></div><div><span style="color:rgb(0,0,0)">Best regards,</span></div><div><span style="color:rgb(0,0,0)">Roman.</span></div></div>