Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] pointcut to match "return" statements

Hi,

is there any way for me to match "return null" statements statically?
I would like to create a policy enforcement aspect that forbids null returns unless the method is marked as @Nullable.

I'm aware this check wouldn't be perfect because it could always be tricked with a variable:

String result = null;
return result;

But still it would make finding errors much easier. Is there any such construct available?

Regards, Sean

Back to the top