[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[List Home]
|
[aspectj-dev] NPE with @args
|
- From: Oliver Böhm <boehm@xxxxxxxxxx>
- Date: Sun, 07 Dec 2008 13:59:30 +0100
- Delivered-to: aspectj-dev@eclipse.org
- Organization: Oli's kleines Rechenzentrum
- User-agent: Thunderbird 2.0.0.18 (X11/20081125)
Hello,
I defined a @NotNull annotation to protect in the first step
constructors like this:
public NotNullTest(@NotNull String s) {
...
}
I defined the following pointcut and (empty) advice:
pointcut ctorWithNotNullArg() :
execution(*..*.new(*)) && @args(NotNull);
before() : ctorWithNotNullArg() {
// empty
}
When I call the NotNullTest constructor with a null string I get a
NullPointerException pointing direct to the first line of the constructor:
java.lang.NullPointerException
at patterntesting.check.runtime.NotNullTest.<init>(NotNullTest.java:48)
at
patterntesting.check.runtime.NotNullTest.testCtorNotNullArg(NotNullTest.java:76)
...
I don't understand why I got a NPE here. When I use "args(String)"
instead of "@args(NotNull)" it works normal. Is this behaviour a known
bug or did I something wrong?
regards
Oliver
--
Oliver Böhm
http://www.javatux.de