[Soot-list] problem on anonymous class
Eric Bodden
eric.bodden at mail.mcgill.ca
Tue Mar 27 09:59:46 EDT 2007
Hi, Kouhei.
Thanks for reporting this. This is a known issue with the exception
checker. I am not quite sure while this bug still exists (I seem to
remember that it's actually a polyglot issue), but there is a debug
flag to disable checking of exceptions altogether:
-debug dontCheckExceptions
Eric
On 26/03/07, Kouhei Sakurai <sakurai at graco.c.u-tokyo.ac.jp> wrote:
> Hi,
>
> I am a user of the Aspect Bench compiler.
> I saw a problem about compilation on a large project.
> The problem was that the abc cannot compile some classes which
> contain an anonymous class.
>
> I think the soot framework has a bug around compilation of anonymous
> class which calls private methods.
> The following sample code will fail compilation with the abc:
> ---------
> public class Example {
> public void run() {
> new Runnable() {
> public void run() {
> try {
> privateRun();
> } catch (Exception e){
> }
> }
> }.run();
> }
>
> private void privateRun() throws Exception {
> throw new Exception();
> }
>
> public static void main(String[] args) {
> new Example().run();
> }
> }
> ---------
> > Example.java: The exception java.lang.Exception must be either
> caught or
> > declared to be thrown in method <Example: void access$000
> (Example)>
> > 1 error.
>
> Probably the reason is that the soot framework does not copy the
> "throws" clause of an outside private method to an access$XXX method.
>
> Thank you,
>
> Kouhei Sakurai
>
>
>
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>
--
Eric Bodden
Sable Research Group
McGill University, Montréal, Canada
More information about the Soot-list
mailing list