Community
Participate
Working Groups
Build Identifier: 20100917-0705 On this class : package com.ubeker.bv.proto.aspects; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import com.ubeker.bv.proto.repository.exceptions.BaseDaoException; public aspect LoggingBehavior { pointcut daoLogger(Object obj) : execution(* *..dao.BaseDao+.*(Object+)) && args(obj); pointcut daoNotLogger() : !within(*..db.BaseDb); pointcut daoIntLogger(int obj) : execution(* *..dao.BaseDao+.*(int)) && args(obj); pointcut daoVoidLogger() : execution(* *..dao.BaseDao+.*()); pointcut daoExceptionLogger() : execution(* *..dao.*Dao.*(..)); before(Object obj) : daoLogger(obj) && daoNotLogger() { Log log = LogFactory.getLog(thisJoinPoint.getTarget().getClass()); log.debug("Entering... - " + thisJoinPointStaticPart.getSignature().toString() + " - " + obj.toString()); } before(int obj) : daoIntLogger(obj) && daoNotLogger() { Log log = LogFactory.getLog(thisJoinPoint.getTarget().getClass()); log.debug("Entering... - " + thisJoinPointStaticPart.getSignature().toString() + " - " + new Integer(obj).toString()); } before() : daoVoidLogger() && daoNotLogger() { Log log = LogFactory.getLog(thisJoinPoint.getTarget().getClass()); log.debug("Entering... - " + thisJoinPointStaticPart.getSignature().toString()); } after() throwing(BaseDaoException ex) : daoExceptionLogger() && !within(LoggingBehavior) { Log log = LogFactory.getLog(thisJoinPoint.getTarget().getClass()); log.error("Exception DAO... - " + ex.toString()); } } <-- editor reports an error here : Dao cannot be resolved to a type. ------- The editor reports an error at the end of the source file. But the error does not appear into the package explorer tree view. Despite of the error, source is running well and aspect are well executed. Dao is a sub-package not a type. If you have an explanation... Reproducible: Always
Created attachment 188207 [details] Screen capture of the editor that reports the error
Created attachment 188208 [details] Screen capture 2 of the editor that reports the error This screen capture display more information about the error.
Version: 2.1.1.e36x-release-20101020-1600 AspectJ version: 1.6.10.20101003133000
Thanks for posting this. This is a problem with reconciling (ie- the way that the AJ editor looks for errors as you type). It is not a compiler problem (as you already mentioned). I am moving this to the AJDT project since the error is likely coming from there.
Finally getting around to this bug and trying to reproduce, but cannot. I created a simple project around the aspect you included above. First, I noticed some syntax errors in the aspect. It looks like some '*'s got lost in the copy/paste. So, I added them. But even after that, I could reproduce the error. I am attaching the simple project I created. Can you see if you are getting the same problem, or if it is missing in this project? I would recommend that you update to the latest dev build of AJDT. It couldn't hurt, but I don't think I have done much in this area lately that would fix this kind of bug.
Created attachment 189121 [details] Simple project that contains the aspect pasted into this bug,
I think the problem is somehow related to this line: pointcut daoExceptionLogger() : execution(* *..dao.*Dao.*(..)); But, since I can't recreate the problem on my end, I can't really be sure.
Hello Andrew, Could please be more precise about the syntax error by displaying the wrong way and the good way ? However I've updated the eclipse and I've still the error. Equinox Weaving SDK org.eclipse.equinox.weaving.sdk.feature.group 1.0.0.v20100421-79--EVVFNFFsFc Eclipse Equinox Project As the source code has changed I've attached the new aspectJ file involved in the error with the screen capture that shows it. Then I've updated AJDT to the version 2.1.2 AJDT Plugin Development Tools 2.1.2.e36x-20110204-1900 org.eclipse.ajdt.pde.build.feature.group AspectJ Development Tools 2.1.2.e36x-20110204-1900 org.eclipse.ajdt.feature.group AspectJ Development Tools (AJDT) Source Code 2.1.2.e36x-20110204-1900 org.eclipse.ajdt.source.feature.group Cross References tool (XRef) 2.1.2.e36x-20110204-1900 org.eclipse.contribution.xref.feature.group Cross References Tool Source Code 2.1.2.e36x-20110204-1900 org.eclipse.contribution.xref.source.feature.group Eclipse Weaving Service Feature 2.1.2.e36x-20110204-1900 org.eclipse.contribution.weaving.feature.group Eclipse Weaving Service Source Code 2.1.2.e36x-20110204-1900 org.eclipse.contribution.weaving.source.feature.group Equinox Weaving SDK 1.0.0.v20090817 org.eclipse.equinox.weaving.sdk.feature.group And... and I still got the same error message !
Created attachment 189125 [details] Screen capture of the editor that reports the error after the update AJDT 2.1.2 So, here is the attachment of the screen capture. I've merged two screen captures to allow you to see the entire file. I've notice that with the update, the error message has changed to "Dao cannot be resolved as a type". Into the Package view, you will see the tree. - com.ubeker.bv.proto.repository.dao are a package that holds only interface. - while com.ubeker.bv.proto.repository.db are the implementation. Into the Cross Reference View, you can see the targeted classes. Then, the first "dao" is a package name while the second "Dao" is a part of the class name. All classes are interfaces in this package. The confusion may be here ?
Created attachment 189126 [details] The verbatim AspectJ source code involved with the bug
I've loaded you project Bug336180 into my workspace and there is no error displayed at the screen. However, you have many warning such as "advice defined in ..... has not been applied [Xlint:adviceDidNotMatch]". Then, that makes a big differences - 1) I've no such errors in my aspectJ file, 2) In the case of the issue, targeted classes are interfaces to allow targeting different implementations of the interfaces. Let me know, if you need more material.
Unfortunately, I still can't reproduce even with the exact text of your aj file. It may be something to do with how the entire project is set up. Can you attach a zip of your project (or at least a minimal project that reproduces this problem)?
You got the source got at this address : andrew@eisenberg.as
Thanks for sending the project. I'll have a look.
OK. I have a fix for this in my local workspace. I need to test the change a bit more. I will let you know when it is available in a dev build. I'll close this issue then.
Now available in latest dev build.