Bug 112880 - fail to compile: java.lang.IllegalStateException at org.aspectj.weaver.ResolvedMemberImpl.parameterizedWith(ResolvedMemberImpl.java:551)
Summary: fail to compile: java.lang.IllegalStateException at org.aspectj.weaver.Resolv...
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: 1.5.0RC1   Edit
Assignee: Adrian Colyer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-17 17:58 EDT by Dan Haywood CLA
Modified: 2005-11-28 06:52 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Haywood CLA 2005-10-17 17:58:48 EDT
On compiling a rather large set of plugins, so apologies for no test program. 
Full stack trace below, though:

java.lang.IllegalStateException
at
org.aspectj.weaver.ResolvedMemberImpl.parameterizedWith(ResolvedMemberImpl.java:551)
at org.aspectj.weaver.ReferenceType.getDeclaredMethods(ReferenceType.java:376)
at org.aspectj.weaver.ResolvedType.addAndRecurse(ResolvedType.java:249)
at org.aspectj.weaver.ResolvedType.addAndRecurse(ResolvedType.java:276)
at org.aspectj.weaver.ResolvedType.getMethodsWithoutIterator(ResolvedType.java:244)
at org.aspectj.weaver.ResolvedType.lookupResolvedMember(ResolvedType.java:346)
at
org.aspectj.weaver.JoinPointSignatureIterator.findSignaturesFromSupertypes(JoinPointSignatureIterator.java:167)
at
org.aspectj.weaver.JoinPointSignatureIterator.hasNext(JoinPointSignatureIterator.java:68)
at org.aspectj.weaver.patterns.SignaturePattern.matches(SignaturePattern.java:129)
at
org.aspectj.weaver.patterns.WithincodePointcut.matchInternal(WithincodePointcut.java:73)
at org.aspectj.weaver.patterns.Pointcut.match(Pointcut.java:143)
at org.aspectj.weaver.patterns.AndPointcut.matchInternal(AndPointcut.java:55)
at org.aspectj.weaver.patterns.Pointcut.match(Pointcut.java:143)
at org.aspectj.weaver.patterns.AndPointcut.matchInternal(AndPointcut.java:55)
at org.aspectj.weaver.patterns.Pointcut.match(Pointcut.java:143)
at org.aspectj.weaver.ShadowMunger.match(ShadowMunger.java:64)
at org.aspectj.weaver.Checker.match(Checker.java:63)
at org.aspectj.weaver.bcel.BcelClassWeaver.match(BcelClassWeaver.java:1748)
at
org.aspectj.weaver.bcel.BcelClassWeaver.matchInvokeInstruction(BcelClassWeaver.java:1735)
at org.aspectj.weaver.bcel.BcelClassWeaver.match(BcelClassWeaver.java:1532)
at org.aspectj.weaver.bcel.BcelClassWeaver.match(BcelClassWeaver.java:1358)
at org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeaver.java:382)
at org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeaver.java:98)
at org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeaver.java:1464)
at org.aspectj.weaver.bcel.BcelWeaver.weaveWithoutDump(BcelWeaver.java:1429)
at org.aspectj.weaver.bcel.BcelWeaver.weaveAndNotify(BcelWeaver.java:1203)
at org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeaver.java:1039)
at
org.aspectj.ajdt.internal.compiler.AjCompilerAdapter.weave(AjCompilerAdapter.java:300)
at
org.aspectj.ajdt.internal.compiler.AjCompilerAdapter.afterCompiling(AjCompilerAdapter.java:178)
at
org.aspectj.ajdt.internal.compiler.CompilerAdapter.ajc$afterReturning$org_aspectj_ajdt_internal_compiler_CompilerAdapter$2$f9cc9ca0(CompilerAdapter.aj:70)
at org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:367)
at
org.aspectj.ajdt.internal.core.builder.AjBuildManager.performCompilation(AjBuildManager.java:759)
at
org.aspectj.ajdt.internal.core.builder.AjBuildManager.doBuild(AjBuildManager.java:225)
at
org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:151)
at org.aspectj.ajde.internal.CompilerAdapter.compile(CompilerAdapter.java:122)
at
org.aspectj.ajde.internal.AspectJBuildManager$CompilerThread.run(AspectJBuildManager.java:191)

trouble in: 
public class
de.berlios.rcpviewer.gui.acme.factory.exts.ColourAttributeGuiFactory extends
org.essentialplatform.louis.factory.attribute.AbstractAttributeGuiFactory:
  static final boolean $assertionsDisabled
  static Class class$0
  static void <clinit>():
    staticinitialization(void
de.berlios.rcpviewer.gui.acme.factory.exts.ColourAttributeGuiFactory.<clinit>())
    |               LDC
de.berlios.rcpviewer.gui.acme.factory.exts.ColourAttributeGuiFactory   (line 29)
    | method-call(boolean java.lang.Class.desiredAssertionStatus())
    | |             INVOKEVIRTUAL java.lang.Class.desiredAssertionStatus ()Z
    | method-call(boolean java.lang.Class.desiredAssertionStatus())
    |               IFNE L0
    |               ICONST_1
    |               GOTO L1
    |           L0: ICONST_0
    |           L1: PUTSTATIC
de.berlios.rcpviewer.gui.acme.factory.exts.ColourAttributeGuiFactory.$assertionsDisabled
Z
    |               RETURN
    staticinitialization(void
de.berlios.rcpviewer.gui.acme.factory.exts.ColourAttributeGuiFactory.<clinit>())
  end static void <clinit>()

  public void <init>():
                    ALOAD_0     //
de.berlios.rcpviewer.gui.acme.factory.exts.ColourAttributeGuiFactory this  
(line 29)
                    INVOKESPECIAL
org.essentialplatform.louis.factory.attribute.AbstractAttributeGuiFactory.<init> ()V
    constructor-execution(void
de.berlios.rcpviewer.gui.acme.factory.exts.ColourAttributeGuiFactory.<init>())
    |               RETURN
    constructor-execution(void
de.berlios.rcpviewer.gui.acme.factory.exts.ColourAttributeGuiFactory.<init>())
  end public void <init>()

  public boolean isApplicable(Object,
org.essentialplatform.louis.factory.IGuiFactory)   
org.aspectj.weaver.MethodDeclarationLineNumber: 35:1257
:
    method-execution(boolean
de.berlios.rcpviewer.gui.acme.factory.exts.ColourAttributeGuiFactory.isApplicable(java.lang.Object,
org.essentialplatform.louis.factory.IGuiFactory))
    |               ALOAD_1     // java.lang.Object model   (line 36)
    |               IFNONNULL L0
    |               NEW java.lang.IllegalArgumentException
    |               DUP
    |               INVOKESPECIAL java.lang.IllegalArgumentException.<init> ()V
    |               ATHROW
    |           L0: ALOAD_1     // java.lang.Object model   (line 37)
    |               INSTANCEOF org.eclipse.emf.ecore.EAttribute
    |               IFEQ L1
    |               LDC org.eclipse.swt.graphics.Color   (line 38)
    |               ALOAD_1     // java.lang.Object model   (line 39)
    |               CHECKCAST org.eclipse.emf.ecore.EAttribute
    | method-call(org.eclipse.emf.ecore.EClassifier
org.eclipse.emf.ecore.EAttribute.getEType())
    | |             INVOKEINTERFACE org.eclipse.emf.ecore.EAttribute.getEType
()Lorg/eclipse/emf/ecore/EClassifier;
    | method-call(org.eclipse.emf.ecore.EClassifier
org.eclipse.emf.ecore.EAttribute.getEType())
    |               INVOKEINTERFACE
org.eclipse.emf.ecore.EClassifier.getInstanceClass ()Ljava/lang/Class;
    |               INVOKEVIRTUAL java.lang.Object.equals (Ljava/lang/Object;)Z
  (line 38)
    |               IRETURN
    |           L1: ICONST_0   (line 41)
    |               IRETURN
    method-execution(boolean
de.berlios.rcpviewer.gui.acme.factory.exts.ColourAttributeGuiFactory.isApplicable(java.lang.Object,
org.essentialplatform.louis.factory.IGuiFactory))
  end public boolean isApplicable(Object,
org.essentialplatform.louis.factory.IGuiFactory)

  protected
org.essentialplatform.louis.factory.attribute.AbstractAttributeFormPart
createFormPart(org.eclipse.emf.ecore.EAttribute)   
org.aspectj.weaver.MethodDeclarationLineNumber: 48:1748
:
                    NEW
de.berlios.rcpviewer.gui.acme.factory.exts.ColourAttributeFormPart   (line 49)
                    DUP
                    ALOAD_1     // org.eclipse.emf.ecore.EAttribute model
                    INVOKESPECIAL
de.berlios.rcpviewer.gui.acme.factory.exts.ColourAttributeFormPart.<init>
(Lorg/eclipse/emf/ecore/EAttribute;)V
                    ARETURN
  end protected
org.essentialplatform.louis.factory.attribute.AbstractAttributeFormPart
createFormPart(org.eclipse.emf.ecore.EAttribute)

  protected org.eclipse.swt.widgets.Text
createMainControl(org.eclipse.swt.widgets.Composite,
org.essentialplatform.louis.factory.attribute.AbstractAttributeFormPart,
org.eclipse.emf.ecore.EAttribute, org.essentialplatform.louis.factory.GuiHints)
   org.aspectj.weaver.MethodDeclarationLineNumber: 56:2136
:
                    NEW org.eclipse.swt.widgets.Text   (line 61)
                    DUP
                    ALOAD_1     // org.eclipse.swt.widgets.Composite parent
                    ICONST_0
                    INVOKESPECIAL org.eclipse.swt.widgets.Text.<init>
(Lorg/eclipse/swt/widgets/Composite;I)V
                    ASTORE 5
                    ALOAD 5     // org.eclipse.swt.widgets.Text text   (line 62)
                    ALOAD_1     // org.eclipse.swt.widgets.Composite parent
                    INVOKEVIRTUAL
org.eclipse.swt.widgets.Composite.getBackground ()Lorg/eclipse/swt/graphics/Color;
                    INVOKEVIRTUAL org.eclipse.swt.widgets.Text.setBackground
(Lorg/eclipse/swt/graphics/Color;)V
                    ALOAD 5     // org.eclipse.swt.widgets.Text text   (line 63)
                    ICONST_0
                    INVOKEVIRTUAL org.eclipse.swt.widgets.Text.setEditable (Z)V
                    ALOAD 5     // org.eclipse.swt.widgets.Text text   (line 64)
                    ALOAD_0     //
de.berlios.rcpviewer.gui.acme.factory.exts.ColourAttributeGuiFactory this
                    ALOAD_3     // org.eclipse.emf.ecore.EAttribute model
                    ALOAD 4     // org.essentialplatform.louis.factory.GuiHints
hints
                    INVOKEVIRTUAL
de.berlios.rcpviewer.gui.acme.factory.exts.ColourAttributeGuiFactory.isEditable
(Lorg/eclipse/emf/ecore/EAttribute;Lorg/essentialplatform/louis/factory/GuiHints;)Z
                    INVOKEVIRTUAL org.eclipse.swt.widgets.Text.setEnabled (Z)V
                    ALOAD 5     // org.eclipse.swt.widgets.Text text   (line 65)
                    ARETURN
  end protected org.eclipse.swt.widgets.Text
createMainControl(org.eclipse.swt.widgets.Composite,
org.essentialplatform.louis.factory.attribute.AbstractAttributeFormPart,
org.eclipse.emf.ecore.EAttribute, org.essentialplatform.louis.factory.GuiHints)

  protected org.eclipse.swt.widgets.Control[]
createAdditionalEditControls(org.eclipse.swt.widgets.Composite,
org.essentialplatform.louis.factory.attribute.AbstractAttributeFormPart,
org.eclipse.emf.ecore.EAttribute, org.essentialplatform.louis.factory.GuiHints)
   org.aspectj.weaver.MethodDeclarationLineNumber: 72:2783
:
                    GETSTATIC
de.berlios.rcpviewer.gui.acme.factory.exts.ColourAttributeGuiFactory.$assertionsDisabled
Z   (line 78)
                    IFNE L0
                    ALOAD_1     // org.eclipse.swt.widgets.Composite parent
                    IFNONNULL L0
                    NEW java.lang.AssertionError
                    DUP
                    INVOKESPECIAL java.lang.AssertionError.<init> ()V
                    ATHROW
                L0: GETSTATIC
de.berlios.rcpviewer.gui.acme.factory.exts.ColourAttributeGuiFactory.$assertionsDisabled
Z   (line 79)
                    IFNE L1
                    ALOAD_2     //
org.essentialplatform.louis.factory.attribute.AbstractAttributeFormPart part
                    IFNONNULL L1
                    NEW java.lang.AssertionError
                    DUP
                    INVOKESPECIAL java.lang.AssertionError.<init> ()V
                    ATHROW
                L1: NEW org.eclipse.swt.widgets.Button   (line 80)
                    DUP
                    ALOAD_1     // org.eclipse.swt.widgets.Composite parent
                    LDC 8388616
                    INVOKESPECIAL org.eclipse.swt.widgets.Button.<init>
(Lorg/eclipse/swt/widgets/Composite;I)V
                    ASTORE 5
                    ALOAD 5     // org.eclipse.swt.widgets.Button change   (line 81)
                    LDC "..."
                    INVOKEVIRTUAL org.eclipse.swt.widgets.Button.setText
(Ljava/lang/String;)V
                    NEW org.eclipse.swt.layout.GridData   (line 82)
                    DUP
                    INVOKESPECIAL org.eclipse.swt.layout.GridData.<init> ()V
                    ASTORE 6
                    ALOAD 6     // org.eclipse.swt.layout.GridData buttonData  
(line 83)
                    ALOAD_2     //
org.essentialplatform.louis.factory.attribute.AbstractAttributeFormPart part
                    INVOKEVIRTUAL
org.essentialplatform.louis.factory.attribute.AbstractAttributeFormPart.getControl
()Lorg/eclipse/swt/widgets/Control;
                    CHECKCAST org.eclipse.swt.widgets.Text
                    INVOKEVIRTUAL org.eclipse.swt.widgets.Text.getLineHeight ()I
                    PUTFIELD org.eclipse.swt.layout.GridData.heightHint I
                    ALOAD 5     // org.eclipse.swt.widgets.Button change   (line 84)
                    ALOAD 6     // org.eclipse.swt.layout.GridData buttonData
                    INVOKEVIRTUAL org.eclipse.swt.widgets.Button.setLayoutData
(Ljava/lang/Object;)V
                    ALOAD 5     // org.eclipse.swt.widgets.Button change   (line 85)
                    NEW
de.berlios.rcpviewer.gui.acme.factory.exts.ColourAttributeGuiFactory$1
                    DUP
                    ALOAD_0     //
de.berlios.rcpviewer.gui.acme.factory.exts.ColourAttributeGuiFactory this
                    ALOAD_1     // org.eclipse.swt.widgets.Composite parent
                    ALOAD_2     //
org.essentialplatform.louis.factory.attribute.AbstractAttributeFormPart part
                    INVOKESPECIAL
de.berlios.rcpviewer.gui.acme.factory.exts.ColourAttributeGuiFactory$1.<init>
(Lde/berlios/rcpviewer/gui/acme/factory/exts/ColourAttributeGuiFactory;Lorg/eclipse/swt/widgets/Composite;Lorg/essentialplatform/louis/factory/attribute/AbstractAttributeFormPart;)V
                    INVOKEVIRTUAL
org.eclipse.swt.widgets.Button.addSelectionListener
(Lorg/eclipse/swt/events/SelectionListener;)V
                    ICONST_1   (line 104)
                    ANEWARRAY org.eclipse.swt.widgets.Control
                    DUP
                    ICONST_0
                    ALOAD 5     // org.eclipse.swt.widgets.Button change
                    AASTORE
                    ARETURN
  end protected org.eclipse.swt.widgets.Control[]
createAdditionalEditControls(org.eclipse.swt.widgets.Composite,
org.essentialplatform.louis.factory.attribute.AbstractAttributeFormPart,
org.eclipse.emf.ecore.EAttribute, org.essentialplatform.louis.factory.GuiHints)

  protected volatile org.eclipse.swt.widgets.Control
createMainControl(org.eclipse.swt.widgets.Composite,
org.essentialplatform.louis.factory.attribute.AbstractAttributeFormPart,
org.eclipse.emf.ecore.EAttribute, org.essentialplatform.louis.factory.GuiHints):
                    ALOAD_0   (line 1)
                    ALOAD_1
                    ALOAD_2
                    CHECKCAST
org.essentialplatform.louis.factory.attribute.AbstractAttributeFormPart
                    ALOAD_3
                    ALOAD 4
                    INVOKEVIRTUAL
de.berlios.rcpviewer.gui.acme.factory.exts.ColourAttributeGuiFactory.createMainControl
(Lorg/eclipse/swt/widgets/Composite;Lorg/essentialplatform/louis/factory/attribute/AbstractAttributeFormPart;Lorg/eclipse/emf/ecore/EAttribute;Lorg/essentialplatform/louis/factory/GuiHints;)Lorg/eclipse/swt/widgets/Text;
                    ARETURN
  end protected volatile org.eclipse.swt.widgets.Control
createMainControl(org.eclipse.swt.widgets.Composite,
org.essentialplatform.louis.factory.attribute.AbstractAttributeFormPart,
org.eclipse.emf.ecore.EAttribute, org.essentialplatform.louis.factory.GuiHints)
end public class
de.berlios.rcpviewer.gui.acme.factory.exts.ColourAttributeGuiFactory

when matching pointcut ((withincode(* de.berlios.rcpviewer.session.IPojo+.*(..))
&& !withincode(void de.berlios.rcpviewer.session.IPojo+.addTo*(..))) &&
call(public boolean java.util.Collection+.add(java.lang.Object+)))
when matching shadow method-call(org.eclipse.emf.ecore.EClassifier
org.eclipse.emf.ecore.EAttribute.getEType())
when weaving type
de.berlios.rcpviewer.gui.acme.factory.exts.ColourAttributeGuiFactory
when weaving classes 
when weaving 
when batch building
BuildConfig[D:\dkhaywood\rcpviewer-workspace\.metadata\.plugins\org.eclipse.ajdt.core\de.berlios.rcpviewer.gui.acme.generated.lst]
#Files=11
Comment 1 Dan Haywood CLA 2005-10-17 18:00:33 EDT
I have a suspicion it might be that the compiler can't cope with:
public class ColourAttributeGuiFactory extends
AbstractAttributeGuiFactory<Color,Text> {

I seem to remember something similar trying to parameterize a Comparator.
Comment 2 Andrew Clement CLA 2005-10-20 12:44:52 EDT
Its a shame the text for the illegalstateexception has been lost - it can be
thrown for a couple of reasons.

I've recently changed parameterization in a quest to get some generic ITDs
working properly.  I know its not a great answer, but can you try with a more
recent AspectJ?  Todays dev build includes a lot of good stuff - but it won't be
available in an AJDT for a few days if thats what you need to retry this.

Comment 3 Adrian Colyer CLA 2005-11-28 06:52:28 EST
I've tried again to reproduce this with the lastest versions of the compiler, but have been unable to do so. Somewhat unsatisfactorily (since we never managed to capture a reliably failing test case) I'm going to have to close this out as "FIXED" (which in this case really means "WE-HIGHLY-SUSPECT-THIS-IS-FIXED-BY-CHANGES-MADE-SINCE-THE-REPORT-WAS-FILED"). If the problem resurfaces using the latest builds then please reopen and we will continue to investigate.

Thanks, Adria.n