Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AJDT » AJDT compiler cannot compile generic class with bounds while JDT compiler compiles without any probl
AJDT compiler cannot compile generic class with bounds while JDT compiler compiles without any probl [message #594520] Thu, 27 July 2006 11:01
Thomas Darimont is currently offline Thomas DarimontFriend
Messages: 10
Registered: July 2009
Junior Member

I have some trouble with compiling some generic classes within an
Eclipse AspectJ Project:

Here is an example which reproduces this error:

A basic Message Interface:

package de.tutorials.aspectj;

public interface IMessage {
void publish();

An error message Interface:
package de.tutorials.aspectj;

public interface IErrorMessage extends IMessage{
StackTraceElement[] getStackTrace();

A generic Message:
package de.tutorials.aspectj;

public class GenericMessage {

public GenericMessage(Class<? extends IMessage> theObjectType) {

public Object createProxy() {
// TODO ...
return null;

The generic ObjectFactory interface:

package de.tutorials.aspectj;

public interface IObjectFactory<E> {
public <T extends E> T create(Class<T> theObjectType, Object[]

A factory for creating Messages:

package de.tutorials.aspectj;

public class MessageFactory implements IObjectFactory<IMessage>{
public <T extends IMessage> T create(Class<T> theObjectType, Object[]
theParameters) {
return theObjectType.cast(new

We use our MessageFactory to create an ErrorMessage without need for
package de.tutorials.aspectj;
public class Main {
public static void main(String[] args) {
IErrorMessage message = new
MessageFactory().create(IErrorMessage.class, new Object[]{"Foo","Bar"});

-> AspectJ Compiler reports:
The type MessageFactory must implement the inherited abstract method
IObjectFactory<IMessage>.create(Class<T>, Object[])

-> JDT Compiler compiles this without any complaints!?

Eclipse Version 3.2
AJDT Version 1.4
AspectJ Version: 1.5.2

Any hints?

Kind regards,
Previous Topic:AJDT 1.3.2 for Eclipse 3.1 Release Candidate
Next Topic:convert from jdt ast to ajdt ast
Goto Forum:

Current Time: Fri Oct 20 09:12:12 GMT 2017

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

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