Community
Participate
Working Groups
This works fine without -emacssym, but dies with it: aspect Foo { before() : call(void foo()) { } void Bar.bar() { foo(); } } class Bar { void foo() { } } munger: (before: (persingleton(Foo) && call(ExactTypePattern(void) foo()))->void Foo.ajc$before$Foo$f()) on method-call(void Bar.foo()) trouble in: public class Foo extends java.lang.Object: TypeMungers: [(BcelTypeMunger ResolvedTypeMunger(Method, void Bar.bar()))] public static final Foo ajc$perSingletonInstance static void <clinit>(): INVOKESTATIC Foo.ajc$clinit ()V (line 1) staticinitialization(void Foo.<clinit>()) | RETURN staticinitialization(void Foo.<clinit>()) end static void <clinit>() void <init>(): ALOAD_0 // Foo this (line 1) INVOKESPECIAL java.lang.Object.<init> ()V constructor-execution(void Foo.<init>()) | RETURN constructor-execution(void Foo.<init>()) end void <init>() public void ajc$before$Foo$f() AdviceAttribute(before, call(ExactTypePattern(void) foo()), 0, 15) : advice-execution(void Foo.ajc$before$Foo$f()) | RETURN (line 2) advice-execution(void Foo.ajc$before$Foo$f()) end public void ajc$before$Foo$f() public static void ajc$interMethod$Foo$Bar$bar(Bar) EffectiveSignatureAttribute(void Bar.bar(), method-execution) : method-execution(void Bar.bar()) | ALOAD_0 // Bar arg0 (line 3) | method-call(void Bar.foo()) | | GETSTATIC Foo.ajc$perSingletonInstance LFoo; | | INVOKEVIRTUAL Foo.ajc$before$Foo$f ()V | | INVOKEVIRTUAL Bar.foo ()V | method-call(void Bar.foo()) | RETURN method-execution(void Bar.bar()) end public static void ajc$interMethod$Foo$Bar$bar(Bar) public static void ajc$interMethodDispatch1$Foo$Bar$bar(Bar) EffectiveSignatureAttribute(void Bar.bar(), method-call) : ALOAD_0 // Bar arg0 INVOKEVIRTUAL Bar.ajc$interMethodDispatch2$$bar ()V RETURN end public static void ajc$interMethodDispatch1$Foo$Bar$bar(Bar) public static Foo aspectOf() org.aspectj.weaver.AjAttribute$AjSynthetic@f8f7db : GETSTATIC Foo.ajc$perSingletonInstance LFoo; ARETURN end public static Foo aspectOf() public static boolean hasAspect() org.aspectj.weaver.AjAttribute$AjSynthetic@5856a5 : GETSTATIC Foo.ajc$perSingletonInstance LFoo; IFNULL L0 ICONST_1 IRETURN L0: ICONST_0 IRETURN end public static boolean hasAspect() private static void ajc$clinit() org.aspectj.weaver.AjAttribute$AjSynthetic@c39a20 : NEW Foo DUP INVOKESPECIAL Foo.<init> ()V PUTSTATIC Foo.ajc$perSingletonInstance LFoo; RETURN end private static void ajc$clinit() end public class Foo Exception thrown from AspectJ 1.1b2 This might be logged as a bug already -- see the bug database at http://dev.eclipse.org (product: AspectJ, component: compiler) Bugs for exceptions thrown have titles File:line from the top stack, e.g., "SomeFile.java:243" If you don't find the exception below in a bug, please add a new bug To make the bug a priority, please include a test program that can reproduce this exception. null java.lang.NullPointerException at org.aspectj.weaver.AsmAdaptor.findOrCreateBodyNode(Unknown Source) at org.aspectj.weaver.AsmAdaptor.getNode(Unknown Source) at org.aspectj.weaver.AsmAdaptor.noteMunger(Unknown Source) at org.aspectj.weaver.Shadow.implementMungers(Unknown Source) at org.aspectj.weaver.Shadow.implement(Unknown Source) at org.aspectj.weaver.bcel.BcelClassWeaver.implement(Unknown Source) at org.aspectj.weaver.bcel.BcelClassWeaver.weave(Unknown Source) at org.aspectj.weaver.bcel.BcelClassWeaver.weave(Unknown Source) at org.aspectj.weaver.bcel.BcelWeaver.weave(Unknown Source) at org.aspectj.weaver.bcel.BcelWeaver.weave(Unknown Source) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.weaveAndGenerateClassFiles(Unknown Source) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(Unknown Source) at org.aspectj.ajdt.ajc.AjdtCommand.runCommand(Unknown Source) at org.aspectj.tools.ajc.Main.run(Unknown Source) at org.aspectj.tools.ajc.Main.runMain(Unknown Source) at org.aspectj.tools.ajc.Main.main(Unknown Source) 1 fail|abort
This bug just touched on the surface of many problems with structure model generation. The worst of those bugs are now all fixed in the current tree. The testcase for these is to run the standard test suite with the -emacssym flag so that model will be generated for every test case in the suite. This bug shows up in all of the ide support implementations, and using - emacssym is a good way of testing all of them minimally.