Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Problem trying to research inner classe method and answer on ques tion mik

Please have a look at the following code:

public abstract exampleClass extends Observable 
{
	public Object getAction() {
		return null;
	}
}

public class exampleExtendedClass extends exampleClass 
{
	private Action anAction = new Action();

	public Object getAction() {
		return anAction;
	}

	private class Action extends AbstractAction {
		public Action() {
			//do things
         	}

        	public void actionPerformed(ActionEvent e) {
  			//click event -> on jmenuitem for example
        	}	
    	}
}

I want an after aspect on the actionPerformed on all inner class extends
from AbstractAction
I use the following pointcut definition:

pointcut aspectBeforeActionPer() : call(*
javax.swing.AbstractAction.actionPerformed+(..));

I also tried the following

pointcut aspectBeforeActionPer() : call(*
javax.swing.AbstractAction+.actionPerformed(..));

Or

pointcut aspectBeforeActionPer() : call(*
javax.swing.AbstractAction.actionPerformed+(..)) && within(exampleClass+);

But the after advice is not reached

// after aspect 
 after() : aspectBeforeActionPer() {
  System.out.println("ACTION PERFORMED");

}

Can anyone tell me what's wrong? 

greetings,

Bas


For Mik:

Subject: RE: [aspectj-users] Compiler Error
Date: Mon, 1 Mar 2004 08:26:04 -0800
Reply-To: aspectj-users@xxxxxxxxxxx

As indicated on the download page AJDE for JBuilder 1.1.1 only supports the
JBuilder 9 distributions.  AJDE 1.0.6 and 1.1b2 support JBuilder versions 4,
5, 6 and 7.  The plan for AJDE 1.2 is to JBuilder X only.

Is it possible for you to upgrade?  
--> For the research on aspectj I now use jBuilderX (this works fine) thanks
for your comment

Are you or your organization planning on sticking with JBuilder 7 for the
foreseeable future?  
--> I can't answer this question, jBuilder 7 SE is for now good enough.

JBuilder X is a significant improvement, and I'm hoping that for the 1.2
release we get to focus our efforts on improving integration with that
version alone.  But it would be good to have a sense of how many people are
stuck on older versions and will be slow to upgrade.
--> I can understand that new releases (of aspectj) will only be available
for the lastest jbuilder version, but new versions of jbuilder are often
released. It would be nice if latest aspectj compiler (1.1.1) is compatible


Back to the top