Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Issue converting old project

I'm having an issue converting an old project, so hopefully I'm just missing something fundamental w/ the tool (AJDT).

The setup:  Using a new aspectj project, I followed some of the Swing threading aspects outlined in the AspectJ in Action book (aside: one of the better technical books I've read).  Everything looked great. I converted my old project over to an AspectJ project (btw, it's the latest version of AJDT, 1.4.1).  I copied the source tree over in another project, setting up the source path as aop/src/<mypackagenametoaspjects>.  The test program had all the aspects being recognized, etc. by the decorations that AJDT provides in the margins.  Oddly, though, none of my other classes in, say <mycompany>/src/<myotherpackages> showed any knowledge of the aspects at all.  I moved all the aspects over to the <mycompany>/src/<mypackagenametoaspjects> and still nothing on my old project sources, but the original test (in the aop/src/<mypackagenametoaspjects> package) was being recognized.  When I move the test file over to my original source path, the test file was no longer being decorated and I was getting the "advice does not match" warning on the aspect (included below).  

So, what am I doing wrong here?  The tool looks like it will help a bunch, and I'm likely missing something obvious--I'd just like to get over this hurdle...TIA.

...Charlie


public aspect LogUIActivitiesAspect {
    pointcut uiActivities() : call(* javax..*+.*(..));

    before() : uiActivities() {
    	System.out.println( "Executing:\n\t"
    			   + thisJoinPointStaticPart.getSignature()
    			   + "\n\t"
    			   + Thread.currentThread() + "\n");
    }
}



public class Test {
    public static void main(String[] args) {
        JFrame appFrame = new JFrame();
        appFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        DefaultTableModel tableModel = new DefaultTableModel(4, 2);

        JTable table = new MyTable2(tableModel);
        JTable table2 = new JTable(tableModel);
        System.out.println(table2);
        appFrame.getContentPane().add(table);
        appFrame.pack();
        appFrame.setVisible(true);
        String value = "[0,0]";
        tableModel.setValueAt(value, 0, 0);
        JOptionPane.showMessageDialog(appFrame, "Press OK to continue");
        int rowCount = tableModel.getRowCount();
        System.out.println("Row count = " + rowCount);
        Color gridColor = table.getGridColor();
        Color d = table2.getGridColor();
        System.out.println("Grid color = " + gridColor + " // " + d);
    }
}


_______________________________________________________
The FREE service that prevents junk email http://www.mailshell.com


Back to the top