Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AspectJ » Parameterized vararg match problem
Parameterized vararg match problem [message #56077] Sun, 28 August 2005 01:44 Go to next message
Roman Kishchenko is currently offline Roman KishchenkoFriend
Messages: 6
Registered: July 2009
Junior Member
Hi,

The pointcut in the example below is not applied.

public class Test1<E> {
public void method1(E...args) {
}
}

public aspect TestAspect {
after(Test1 test1, Object[] arg) returning: execution(*
Test1.method1(Object...)) && target(test1) && args(arg) {
System.out.println("got here");
}
}

If I remove vararg from the pointcut declaration (below) then the pointcut
is applied ok.


public aspect TestAspect {
after(Test1 test1) returning: execution(* Test1.method1(Object...)) &&
target(test1) {
System.out.println("got here");
}
}

Is there something wrong with the declaration or is it a bug?

I am using AJDT M3.

Thanks,
Roman
Re: Parameterized vararg match problem [message #56157 is a reply to message #56077] Tue, 30 August 2005 16:37 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: adrian_colyer.uk.ibm.com

Roman Kishchenko wrote:
> Hi,
>
> The pointcut in the example below is not applied.
>
> public class Test1<E> {
> public void method1(E...args) {
> }
> }
>
> public aspect TestAspect {
> after(Test1 test1, Object[] arg) returning: execution(*
> Test1.method1(Object...)) && target(test1) && args(arg) {
> System.out.println("got here");
> }
> }
>

I confirm I can reproduce this bug. It only occurs when the vararg type
is a type parameter (ie. if you change the definition of method1 to take
an (Object... args) parameter then the matching works as expected.

Please raise a bug report and I'll get this fixed for you.
Thks, Adrian.
Re: Parameterized vararg match problem [message #56311 is a reply to message #56157] Wed, 31 August 2005 00:19 Go to previous message
Roman Kishchenko is currently offline Roman KishchenkoFriend
Messages: 6
Registered: July 2009
Junior Member
https://bugs.eclipse.org/bugs/show_bug.cgi?id=108437

Thanks,
Roman

"Adrian Colyer" <adrian_colyer@uk.ibm.com> wrote in message
news:df220a$b4h$1@news.eclipse.org...
> Roman Kishchenko wrote:
>> Hi,
>>
>> The pointcut in the example below is not applied.
>>
>> public class Test1<E> {
>> public void method1(E...args) {
>> }
>> }
>>
>> public aspect TestAspect {
>> after(Test1 test1, Object[] arg) returning: execution(*
>> Test1.method1(Object...)) && target(test1) && args(arg) {
>> System.out.println("got here");
>> }
>> }
>>
>
> I confirm I can reproduce this bug. It only occurs when the vararg type is
> a type parameter (ie. if you change the definition of method1 to take an
> (Object... args) parameter then the matching works as expected.
>
> Please raise a bug report and I'll get this fixed for you.
> Thks, Adrian.
Re: Parameterized vararg match problem [message #589937 is a reply to message #56077] Tue, 30 August 2005 16:37 Go to previous message
Adrian Colyer is currently offline Adrian ColyerFriend
Messages: 61
Registered: July 2009
Member
Roman Kishchenko wrote:
> Hi,
>
> The pointcut in the example below is not applied.
>
> public class Test1<E> {
> public void method1(E...args) {
> }
> }
>
> public aspect TestAspect {
> after(Test1 test1, Object[] arg) returning: execution(*
> Test1.method1(Object...)) && target(test1) && args(arg) {
> System.out.println("got here");
> }
> }
>

I confirm I can reproduce this bug. It only occurs when the vararg type
is a type parameter (ie. if you change the definition of method1 to take
an (Object... args) parameter then the matching works as expected.

Please raise a bug report and I'll get this fixed for you.
Thks, Adrian.
Re: Parameterized vararg match problem [message #589954 is a reply to message #56157] Wed, 31 August 2005 00:19 Go to previous message
Roman Kishchenko is currently offline Roman KishchenkoFriend
Messages: 6
Registered: July 2009
Junior Member
https://bugs.eclipse.org/bugs/show_bug.cgi?id=108437

Thanks,
Roman

"Adrian Colyer" <adrian_colyer@uk.ibm.com> wrote in message
news:df220a$b4h$1@news.eclipse.org...
> Roman Kishchenko wrote:
>> Hi,
>>
>> The pointcut in the example below is not applied.
>>
>> public class Test1<E> {
>> public void method1(E...args) {
>> }
>> }
>>
>> public aspect TestAspect {
>> after(Test1 test1, Object[] arg) returning: execution(*
>> Test1.method1(Object...)) && target(test1) && args(arg) {
>> System.out.println("got here");
>> }
>> }
>>
>
> I confirm I can reproduce this bug. It only occurs when the vararg type is
> a type parameter (ie. if you change the definition of method1 to take an
> (Object... args) parameter then the matching works as expected.
>
> Please raise a bug report and I'll get this fixed for you.
> Thks, Adrian.
Previous Topic:ClassFormatError
Next Topic:Adding an interace to class based on it implementing a interface.
Goto Forum:
  


Current Time: Fri Mar 29 15:11:06 GMT 2024

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

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

Back to the top