Behavior of PointcutElement.getSource() is very strange [message #58643] |
Thu, 17 November 2005 01:19  |
Eclipse User |
|
|
|
Hi, all
Occasionally, I found the behavior of PointcutElement.getSource() is
very strange. It doesn't return the full source of pointcut expression,
instead, it just returns head of the expression following many blank
space. For example, the resource is:
public pointcut pt3(): execution(public String main.Experiment*.toString())
||execution(public static void main.Hello*.main(String[]))
||execution(public int main.Hello*.testfieldset())
||execution(public void test.pack.Apple*.hello())
||execution(public void test.pack.Apple*.Apple(int))
||execution(public void test.pack.ITestInterface*.methodininterface())
||execution(public void test.pack.GoodApple*.hello());
But the getSource() function will return something as follows:
public pointcut pt3()
;
Is this a bug?
James Gan
|
|
|
Re: Behavior of PointcutElement.getSource() is very strange [message #58712 is a reply to message #58643] |
Thu, 17 November 2005 09:55  |
Eclipse User |
|
|
|
Hi James,
It's an unfortunate effect of the current AJDT implementation - so as to
not confuse JDT, things like pointcuts pretend to be methods etc. To
obtain the real source you have to make a special call to the containing
compilation unit first. An example of this is in ajdt.ui in
PointcutSourceHover.java line 64. If you need more details, please ask on
the ajdt-dev mailing list.
Regards,
Matt.
On Thu, 17 Nov 2005 14:19:02 +0800, James Gan wrote:
> Hi, all
>
> Occasionally, I found the behavior of PointcutElement.getSource() is
> very strange. It doesn't return the full source of pointcut expression,
> instead, it just returns head of the expression following many blank
> space. For example, the resource is:
>
> public pointcut pt3(): execution(public String main.Experiment*.toString())
> ||execution(public static void main.Hello*.main(String[]))
> ||execution(public int main.Hello*.testfieldset())
> ||execution(public void test.pack.Apple*.hello())
> ||execution(public void test.pack.Apple*.Apple(int))
> ||execution(public void test.pack.ITestInterface*.methodininterface())
> ||execution(public void test.pack.GoodApple*.hello());
>
> But the getSource() function will return something as follows:
>
> public pointcut pt3()
>
> ;
>
> Is this a bug?
>
> James Gan
|
|
|
Re: Behavior of PointcutElement.getSource() is very strange [message #590962 is a reply to message #58643] |
Thu, 17 November 2005 09:55  |
Eclipse User |
|
|
|
Hi James,
It's an unfortunate effect of the current AJDT implementation - so as to
not confuse JDT, things like pointcuts pretend to be methods etc. To
obtain the real source you have to make a special call to the containing
compilation unit first. An example of this is in ajdt.ui in
PointcutSourceHover.java line 64. If you need more details, please ask on
the ajdt-dev mailing list.
Regards,
Matt.
On Thu, 17 Nov 2005 14:19:02 +0800, James Gan wrote:
> Hi, all
>
> Occasionally, I found the behavior of PointcutElement.getSource() is
> very strange. It doesn't return the full source of pointcut expression,
> instead, it just returns head of the expression following many blank
> space. For example, the resource is:
>
> public pointcut pt3(): execution(public String main.Experiment*.toString())
> ||execution(public static void main.Hello*.main(String[]))
> ||execution(public int main.Hello*.testfieldset())
> ||execution(public void test.pack.Apple*.hello())
> ||execution(public void test.pack.Apple*.Apple(int))
> ||execution(public void test.pack.ITestInterface*.methodininterface())
> ||execution(public void test.pack.GoodApple*.hello());
>
> But the getSource() function will return something as follows:
>
> public pointcut pt3()
>
> ;
>
> Is this a bug?
>
> James Gan
|
|
|
Powered by
FUDForum. Page generated in 0.23571 seconds