Skip to main content

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

Have you tried the support for null/notnull checks that are supported in the Eclipse Java compiler? http://wiki.eclipse.org/JDT_Core/Null_Analysis - this compiler can be used outside of eclipse. I don't know if it precisely checks the kind of thing you are describing though.

As already discussed here, you can check the return value but not pick out the 'return null' pattern directly, unfortunately.  That could be done with a small asm visitor of a few lines...

cheers,
Andy


On 6 January 2014 07:14, Sean Patrick Floyd <seanpfloyd@xxxxxxxxxxxxxx> wrote:
On 06.01.2014 15:59, Alexander Kriegisch wrote:
A) Returning null is not necessarily a programming error. Not handling null results gracefully might be though.

I'm aware of that, that's why we allow the @Nullable annotation for such cases.


B) How should it be possible to statically determine a non-trivial (dynamically created) return value during compile time? If you want to catch typical, statically determinable bugs using a byte code analyser, I recommend Findbugs.

As I said, I would exclude the non-trivial cases. If someone tries hard to cheat, they always can.
We use findbugs already, but not in the build process. We already have some policy enforcement aspects and I'd like devs to get immediate feedback without prolonging the build process significantly.


_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users


Back to the top