Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AspectJ » ClassFormatError
ClassFormatError [message #589914] Mon, 29 August 2005 16:26
Eclipse UserFriend
Originally posted by: schulz78.gmx.net

I am using AJDT 1.3 (20050729161227) with Eclipse 3.1 in a multiproject
setup. One plugin defines aspects that are woven into the class files
produced when compiling other plugins. The projects are linked via the
aspectpath option. Classes within the aspect-defining plugin are woven
correctly. However, when the aspects are applied to the classes of
another plugin things go wrong. When I start up my application the VM
moans about classes with duplicate interfaces (ClassFormatError).
Decompiling my classes with JAD unveils that in fact classes are defined
to implement one and the same interface twice. Furthermore fields are
generated twice, which would produce an error too, if the verification
wouldn't stumble across the duplicate interface. I guess that the class
is woven twice, but I don't know why? It might be a bug, too! I'm using
annotation style aspects.

Here is a woven decompiled sample class:

Original:
---------

@Managed
public class Test {

public Test() {
}

}

Woven (decompiled):
-------------------

public class Test
implements de.cohesion.lmf.ManagementAspect.ajcMightHaveAspect,
de.cohesion.lmf.ManagementAspect.ajcMightHaveAspect
{

public Test()
{
JoinPoint joinpoint = Factory.makeJP(ajc$tjp_0, this, this);
ManagementAspect.ajc$perObjectBind(this);
init$_aroundBody1$advice(this, joinpoint,
CallstackAspect.aspectOf(), this, null, joinpoint);
}

public ManagementAspect
ajc$de_cohesion_lmf_ManagementAspect$perObjectGet()
{
return ajc$de_cohesion_lmf_ManagementAspect$perObjectField;
}

public void
ajc$de_cohesion_lmf_ManagementAspect$perObjectSet(Management Aspect
managementaspect)
{
ajc$de_cohesion_lmf_ManagementAspect$perObjectField =
managementaspect;
}

private static final void init$_aroundBody0(Test test, JoinPoint
joinpoint)
{
if(ManagementAspect.hasAspect(test))

ManagementAspect.aspectOf(test).ajc$before$de_cohesion_lmf_M anagementAspect$1$2e8d3d(test);
}

private static final Object
init$_aroundBody1$advice(CallstackAspect this, Object o, AroundClosure
ajc_aroundClosure, JoinPoint thisJoinPoint, Stack stack, JoinPoint
joinpoint)
{
Stack stack1;
stack1 =
(Stack)CallstackAspect.ajc$inlineAccessFieldGet$de_cohesion_ lmf_trace_CallstackAspect$de_cohesion_lmf_trace_CallstackAsp ect$stacks(ajc_aroundClosure).get();
stack1.push(new Invocation(thisJoinPoint,
JoinPoints.getConstructor(joinpoint), joinpoint.getArgs()));
Object obj;
Stack stack2 = stack;
JoinPoint joinpoint1 = thisJoinPoint;
init$_aroundBody0((Test)joinpoint1, ((JoinPoint) (o)));
obj = null;
stack1.pop();
return obj;
Exception exception;
exception;
stack1.pop();
throw exception;
}

public ManagementAspect
ajc$de_cohesion_lmf_ManagementAspect$perObjectGet()
{
return ajc$de_cohesion_lmf_ManagementAspect$perObjectField;
}

public void
ajc$de_cohesion_lmf_ManagementAspect$perObjectSet(Management Aspect
managementaspect)
{
ajc$de_cohesion_lmf_ManagementAspect$perObjectField =
managementaspect;
}

private transient ManagementAspect
ajc$de_cohesion_lmf_ManagementAspect$perObjectField;
private static final org.aspectj.lang.JoinPoint.StaticPart ajc$tjp_0;
private transient ManagementAspect
ajc$de_cohesion_lmf_ManagementAspect$perObjectField;

static
{
Factory factory = new Factory("Test.java",
Class.forName("de.cohesion.test.Test"));
ajc$tjp_0 = factory.makeSJP("constructor-execution",
factory.makeConstructorSig("1--de.cohesion.test.Test----"), 31);
}
}
Previous Topic:Parameterized vararg match problem
Next Topic:Parameterized vararg match problem
Goto Forum:
  


Current Time: Thu Apr 25 00:05:29 GMT 2024

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

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

Back to the top