Hi,
I am using 'execution' here but this format shows the markers properly.
pointcut traceGetSQLResultset( Connection dbConn, String sql,
JdbcParm... values) :
Object[][] around(Connection dbConn, String sql, JdbcParm[] values) :
execution( Object[][] *.getResultSetBound(Connection, String,
JdbcParm...)) &&
args(dbConn, sql, values) {
System.out.println(sql);
return proceed(dbConn, sql, values);
}
Thanks,
Mohan
On Tue, May 18, 2010 at 7:18 PM, Roger Gilliar <[email protected]> wrote:
> Ok,
>
> after correcting my typo I'm now sure that JdbcParm [] doesn't match
> JdbcParm... values since I get a match if I change the signature of my
> method to getResultSetBound(final Connection dbConn, final String sql,
> JdbcParm[] values).
>
> The question remains: How do I write a pointcut for a method with varargs.
>
> Regards
> Roger
>
>> I would like to trace the following method. But I can't figure out how to
>> handle the varargs:
>>
>> public Object[][] getResultSetBound(final Connection dbConn, final String
>> sql, final JdbcParm... values) {
>> return getResultSetBound(dbConn, sql, null, values);
>> }
>>
>> My aspect is:
>>
>> pointcut traceGetSQLResultset(Connection dbConn, String sql, JdbcParm[]
>> values) :
>> call(Object[][] LibUtil,getResultSetBound(Connection, String,
>> JdbcParm [])) &&
>> args(dbConn, sql, values);
>>
>>
>> Object[][] around(Connection dbConn, String sql, JdbcParm[] values) :
>> traceGetSQLResultset(dbConn, sql, values) {
>> System.out.println(sql);
>> return proceed(dbConn, sql, values);
>> }
>>
>> But the advice is not applied.
>>
>> What I'm doing wrong ?
>>
>> Regards
>> Roger
>> _______________________________________________
>> aspectj-users mailing list
>> [email protected]
>> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
> _______________________________________________
> aspectj-users mailing list
> [email protected]
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
_______________________________________________
aspectj-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/aspectj-users