[Soot-list] Do I understand traps?

Martin Schäf martinschaef at googlemail.com
Tue Jan 17 05:18:05 EST 2012


Well, the thing with the throws clause is cool with me... but I do not
understand why this method has a trap.
If you look at the source code of javap
javax.swing.text.JTextComponent (see my last email), the exception is
not caught ...
But the SootMethod definitely has a trap referring to a "r..:=
$caughtexception ..$ statement which I do not see in the Java program.


2012/1/17 Eric Bodden <eric.bodden at ec-spride.de>:
> Hi Martin.
>
> While this exception is documented in the JavaDoc, there is no actual
> exception annotation on the method in the JDK's bytecode:
>
> $ javap javax.swing.text.JTextComponent | grep setCaretPosition
>    public void setCaretPosition(int);
>
> You can also see it in the source...
>
>>            public void setCaretPosition(int position) {
>
> That's why Soot says that the method "does not throw anything".
> Basically, this means that the method does not throw any *checked*
> exceptions.
>
>> When debugging into the sootMethod, I find a trap that handles this
>> exception including a catch-block, i.e., it is not thrown out.
>
> The trap would then originate from a try/catch block in the source
> code this sootMethod was generated from.
>
> Eric


More information about the Soot-list mailing list