Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AspectJ » intertype declarations in separate project(Having difficulty getting intertype declarations in a separate Eclipse project to work.)
intertype declarations in separate project [message #633691] Mon, 18 October 2010 22:33 Go to next message
Alan Krueger is currently offline Alan KruegerFriend
Messages: 2
Registered: July 2009
Junior Member
Say I have the following in a project called Test.

Test/src/some/pkg/Foo.java:
package some.pkg;
public interface Foo {
	void bar();
}

Test/src/some/pkg/FooImpl.aj:
package some.pkg;
public aspect FooImpl {
	public void Foo.bar() {
		System.out.println("AJDT");
	}
}

Test/src/some/pkg/Baz.java
package some.pkg;
public class Baz implements Foo {
}


This works fine. However, if you refactor and move Baz to another project that depends on this one, it will fail to compile because it doesn't implement the method bar.

Do aspects in AJDT only work within a single project? Is it not possible to do cross-project intertypes like this?
Re: intertype declarations in separate project [message #633716 is a reply to message #633691] Tue, 19 October 2010 05:15 Go to previous messageGo to next message
Andrew Eisenberg is currently offline Andrew EisenbergFriend
Messages: 382
Registered: July 2009
Senior Member
ITD certainly do work across projects, but there are certain ways that you need to set your projects up to ensure this works.

First, in order to get compilation to work, you need to make sure that the dependent project places the depending project on its aspect path. This further requires that the dependent project is an aspectj project as well.
icon14.gif  Re: intertype declarations in separate project [message #633813 is a reply to message #633691] Tue, 19 October 2010 13:57 Go to previous message
Alan Krueger is currently offline Alan KruegerFriend
Messages: 2
Registered: July 2009
Junior Member
Thanks, that was the piece I was missing.
Previous Topic:adjt causes eclipse for lockups
Next Topic:Aspect not applied after adding annotation
Goto Forum:
  


Current Time: Fri Apr 26 06:42:34 GMT 2024

Powered by FUDForum. Page generated in 0.02836 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top