[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[List Home]
|
Re: [aspectj-dev] NPE with @args
|
- From: "Eric Bodden" <eric.bodden@xxxxxxxxxxxxxx>
- Date: Sun, 7 Dec 2008 11:06:03 -0500
- Delivered-to: aspectj-dev@eclipse.org
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references :x-google-sender-auth; bh=+EyvZGMQq123rbDj9AfUl0OL7/CudT254Y4sJ02KEyQ=; b=FLqdgKKYfB9SJGwNEzipC3hxfGbri+6vCjmPhXV8rcOdjR/gOHqPjBjJGdPgk9xWC2 CHcY2uqeCjw051SbQS8xPZEPv2mcbFqWQszzwP6DRVfH+gq1mnLvzUyKguh34xeFpLzT TXe5lyLQR2/hELpp++UBif8ROfBbOGxo3KevY=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:date:from:sender:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references:x-google-sender-auth; b=hVqOXe8brRnj4ivmSn7j3JIbkS5oY/9beQdV+H3z/2KUX8vKXniiDNjM6Uo4Bidt/p risjqIcywNn+BQicx072Qhcx2uT+r4CGyJwIfv9hr8ea5PLx/wBFLx8hzESm3F0CDVUz 7AbkkxARM52bDNg1o8WIEcNmbbWW34YSlSXX8=
Hi Oliver. Although I am not a developer in the aspectj project I
think it's fair to say that this looks a lot like a bug in the
implementation of the aspectj compiler. I think it would be good to
raise a bug report.
Eric
2008/12/7 Oliver Böhm <boehm@xxxxxxxxxx>:
> 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
> _______________________________________________
> aspectj-dev mailing list
> aspectj-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-dev
>
--
Eric Bodden
Sable Research Group, McGill University, Montréal, Canada
Got an interesting job offer? http://www.bodden.de/hire-me/