Bug 269286 - [handles] Handle for method with @Before looks like advice, but should look like method
Summary: [handles] Handle for method with @Before looks like advice, but should look l...
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Build (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P2 major (vote)
Target Milestone: 1.6.4   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 270200 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-03-18 16:55 EDT by Andrew Eisenberg CLA
Modified: 2009-03-27 14:11 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Eisenberg CLA 2009-03-18 16:55:49 EDT
In this code:
@Aspect
public class Logger {

	@Before("execution(* Other.*())")
	public void foo() {
		
	}
}

The aspectj handle for method foo looks like this: 
=Boo/src<h{Logger.java}Logger&foo

There are two problems with this.  According to the text:
1. Logger is a class, not an aspect 
2. foo is a method, not advice

So, I would like to see something like this:
=Boo/src<h{Logger.java[Logger~foo

Would it be possible to generate the handle based on the text, rather than what it represents in the compiler?

The same goes for other @Aspect kinds like pointcuts and declare.  These kinds of elements should not have any aspecty parts to their handles.  It should look like Java handles.
Comment 1 Andrew Clement CLA 2009-03-18 17:09:13 EDT
i guess the handle could be based on the declaration, but we'll have to undo some stuff - hopefully the necessary information is around to identify these are annotation style constructs.
Comment 2 Andrew Eisenberg CLA 2009-03-27 12:26:07 EDT
*** Bug 270200 has been marked as a duplicate of this bug. ***
Comment 3 paul freeman CLA 2009-03-27 12:32:49 EDT
I suggest that this bug should be marked as major as it removed functionality that existed in the xref view using previous versions of aspectj.  See duplicate bug 270200.  The greatly hinders development of @AspectJ sytax aspects.
Comment 4 Andrew Clement CLA 2009-03-27 12:37:20 EDT
indeed. shame it wasnt found sooner.
Comment 5 Andrew Clement CLA 2009-03-27 13:33:13 EDT
fixed for aspects, advice, decw, dece - that should cover the major issues.  Not fixed for pointcuts or declareparents - the former seems to have some kind of other issue internally where the pointcut methods are modified in name by ajc (doesn't seem right) - and no-one can be using @declareparents or we'd have a million reported problems due to it not supporting incremental compilation.  I'll address these if they come up, but important that the basics now work.

I guess this means the last couple of AJDTs are pretty much useless for annotation style development, including the one in STS.

Needs some AJDT tests for anno style I think, given that the only spec the handles must obey for use in AspectJ is that they are a unique identifier for an element in the hierarchy.

follow on problems which don't seem so urgent unless i hear otherwise are in bug 270305
Comment 6 Andrew Eisenberg CLA 2009-03-27 13:56:32 EDT
Nice moving with this one.  Is this already in AJDT?
Comment 7 Andrew Clement CLA 2009-03-27 14:11:45 EDT
no - i'm tired of doing aj upgrades in ajdt every few mins :)  I'll do one a bit later that will have whatever i've achieved in other bugs too.