Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AJDT » Behavior of PointcutElement.getSource() is very strange
Behavior of PointcutElement.getSource() is very strange [message #58643] Thu, 17 November 2005 06:19 Go to next message
James Gan is currently offline James Gan
Messages: 27
Registered: July 2009
Junior Member
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 14:55 Go to previous message
Matt Chapman is currently offline Matt Chapman
Messages: 429
Registered: July 2009
Senior Member
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 14:55 Go to previous message
Matt Chapman is currently offline Matt Chapman
Messages: 429
Registered: July 2009
Senior Member
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
Previous Topic:How to disable auto-compile AspectJ project in Eclipse 3.1
Next Topic:AspectJ 5 M5
Goto Forum:
  


Current Time: Sun Sep 21 22:19:28 GMT 2014

Powered by FUDForum. Page generated in 0.01643 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software