Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Exception Detection in AspectJ

Hi all,

Is that possible to use AspectJ for exception detectionof a Java program?

Suppose in a Java program, method foo() invokes method zoo() which will throw IOException.

public void foo() {
    zoo();
}

This piece of code won't pass the java compiler since foo() should either hander the IOException or throw it. So I'm wondering if I can use AspectJ to detect the exception that will be thrown by zoo() and add a Throws-Statement in foo() automatically ?

Thanks a lot.

Yimeng

Back to the top