Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] error Ambiguous binding - args(..) pointcut

Hi, see enhancement request

https://bugs.eclipse.org/bugs/show_bug.cgi?id=61568

This enhancement has been implemented in abc, *but* it is *not*
yet part of the official AspectJ language. Please see

http://abc.comlab.ox.ac.uk/differences

for a full list of differences between abc and ajc. All major
differences are controlled by explicit commandline switches, but we
felt this one was a minor issue, so we didn't put it under a switch
yet. Wes has cogently argued that we ought to be more careful with
such decisions, to avoid confusion about the precise language
definition.

abc is a research compiler for AspectJ, which implements the full
AspectJ language plus some new features. It also applies a
number of novel optimisations. abc is intended as a testbed
for new ideas, and ideas that have proven their worth will
find their way into ajc, the production compiler. The abc team
is working with the ajc team to facilitate such technology
transfer.

So, why not try to compile your program with abc?
If you find this feature useful, please let both us (the abc
developers) and the ajc developers know. Enough good use cases
will make sure it becomes part of the official language.

More generally, the abc team (see aspectbench.org for relevant
email lists) loves to hear of new feature requests. The
idea is that ajc steams ahead with the production tools,
while abc plays the research role.

Best wishes,

-Oege

On Fri, 12 Nov 2004, JITESH KALYANI Shivanand wrote:

> HI there,
>
> ERROR:
> see also: D:\JDBC.java:17
>  see also: D:\bea813\weblogic81\samples\server\examples\src\examples\ejb20\basic\beanManaged\dist\ejb20_basic_beanManaged.jar
> examples\ejb20\basic\beanManaged\AccountBean.java:127 error Ambiguous binding of type java.lang.String using args(..) at this line.  Use one args(..) per matched join point, see secondary source location for location of extraneous args(..)
> (no source information available)
>
> When I weave the following code with weblogic 8.1.3 beanmanaged example Account entity EJB, I am getting follwoing above error,
> Please let me know what is the problem?
>
> Regards,
> Jitesh
>
> public aspect JDBC {
>   public pointcut getConnection() : call(public Connection Driver.connect(..)) || call(public Connection DataSource.getConnection(..));
>   public pointcut closeConnection() : call(public void Connection.close());
>   public pointcut commit() : call(public void Connection.commit());
>
> //--------------------------------------------------------------------------------------------------
>  //clubbed all this in query pointcut
>
>   public pointcut preparedStatement(String sql) : call(public * Connection.prepareStatement(..)) && args(sql);
>   public pointcut preparedCall(String sql) : call(public * Connection.prepareCall(..)) && args(sql);
>
>   public pointcut statement(String sql) : call(public * Statement.execute*(..)) && args(sql);
>   public pointcut addBatch(String sql) : call(public * Statement.addBatch(String)) && args(sql);
>   public pointcut setCommand(String sql) : call(public * RowSet.setCommand(..)) && args(sql);
>
> //--------------------------------------------------------------------------------------------------
>
>   public pointcut query(String sql) : JDBC.preparedStatement(sql) || JDBC.preparedCall(sql) ||
>     JDBC.statement(sql) || JDBC.addBatch(sql) || JDBC.setCommand(sql);
>
> Object around(String sql): query(sql) {
>      System.out.println("Query"+sql);
>     //execute called method
>     res = proceed(sql);
>     return res;
> }
> Confidentiality Statement:
>
> This message is intended only for the individual or entity to which it is addressed. It may contain privileged, confidential information which is exempt from disclosure under applicable laws. If you are not the intended recipient, please note that you are strictly prohibited from disseminating or distributing this information (other than to the intended recipient) or copying this information. If you have received this communication in error, please notify us immediately by return email.
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/aspectj-users
>


Back to the top