Bug 336180 - The editor warns for error but there is no error - Everything is compiling...
Summary: The editor warns for error but there is no error - Everything is compiling...
Status: RESOLVED FIXED
Alias: None
Product: AJDT
Classification: Tools
Component: UI (show other bugs)
Version: 2.1.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 2.1.2   Edit
Assignee: AJDT-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-02 20:07 EST by Jorelia CLA
Modified: 2011-03-01 13:00 EST (History)
1 user (show)

See Also:


Attachments
Screen capture of the editor that reports the error (124.11 KB, image/png)
2011-02-02 20:09 EST, Jorelia CLA
no flags Details
Screen capture 2 of the editor that reports the error (126.74 KB, image/png)
2011-02-02 20:10 EST, Jorelia CLA
no flags Details
Simple project that contains the aspect pasted into this bug, (2.62 KB, application/octet-stream)
2011-02-16 12:40 EST, Andrew Eisenberg CLA
no flags Details
Screen capture of the editor that reports the error after the update AJDT 2.1.2 (160.98 KB, image/png)
2011-02-16 14:07 EST, Jorelia CLA
no flags Details
The verbatim AspectJ source code involved with the bug (1.45 KB, application/octet-stream)
2011-02-16 14:10 EST, Jorelia CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jorelia CLA 2011-02-02 20:07:51 EST
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
Comment 1 Jorelia CLA 2011-02-02 20:09:59 EST
Created attachment 188207 [details]
Screen capture of the editor that reports the error
Comment 2 Jorelia CLA 2011-02-02 20:10:48 EST
Created attachment 188208 [details]
Screen capture 2 of the editor that reports the error

This screen capture display more information about the error.
Comment 3 Jorelia CLA 2011-02-02 20:13:27 EST
Version: 2.1.1.e36x-release-20101020-1600
AspectJ version: 1.6.10.20101003133000
Comment 4 Andrew Eisenberg CLA 2011-02-03 00:25:48 EST
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.
Comment 5 Andrew Eisenberg CLA 2011-02-16 12:39:31 EST
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.
Comment 6 Andrew Eisenberg CLA 2011-02-16 12:40:23 EST
Created attachment 189121 [details]
Simple project that contains the aspect pasted into this bug,
Comment 7 Andrew Eisenberg CLA 2011-02-16 12:43:38 EST
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.
Comment 8 Jorelia CLA 2011-02-16 13:49:26 EST
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 !
Comment 9 Jorelia CLA 2011-02-16 14:07:52 EST
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 ?
Comment 10 Jorelia CLA 2011-02-16 14:10:41 EST
Created attachment 189126 [details]
The verbatim AspectJ source code involved with the bug
Comment 11 Jorelia CLA 2011-02-16 14:42:09 EST
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.
Comment 12 Andrew Eisenberg CLA 2011-02-16 14:50:29 EST
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)?
Comment 13 Jorelia CLA 2011-02-16 15:36:07 EST
You got the source got at this address : andrew@eisenberg.as
Comment 14 Andrew Eisenberg CLA 2011-02-16 16:19:38 EST
Thanks for sending the project.  I'll have a look.
Comment 15 Andrew Eisenberg CLA 2011-02-18 12:28:47 EST
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.
Comment 16 Andrew Eisenberg CLA 2011-03-01 12:59:44 EST
Now available in latest dev build.