Bug 110927 - Problem creating signature for type implementing non-parameterized interfaces
Summary: Problem creating signature for type implementing non-parameterized interfaces
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: DEVELOPMENT   Edit
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: 1.5.0 M4   Edit
Assignee: Andrew Clement CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-28 09:03 EDT by Andrew Clement CLA
Modified: 2005-09-30 08:14 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Clement CLA 2005-09-28 09:03:57 EDT
From the mailing list (stephane.chomat@imag.fr):

Hi
I have a null pointeur exception at
org.aspectj.weaver.ReferenceType.makeDeclaredSignature. The
referenceType has no genericType and no typeParameters.

I attached a eclipse project eclipses which shows the problem with
apectj. The problem comes that there is a generic interface  and a non
generic interface.

This sample pattern is :

interface I {
}

interface IE1<T> {

}

interface IE2 {

}

aspect A1 {
       declare parents : I implements  IE1<String>;
}

aspect A2 {
       declare parents : I implements  IE2;
}

A first solution is to add a test to the beginning of method
getSignatureForAttribute before the call of makeDeclaredSignature.

   public String getSignatureForAttribute() {
       if (genericType == null || typeParameters == null)
           return this.getSignature();
       return makeDeclaredSignature(genericType,typeParameters);
   }

I think it resolve my problem.
Thanks.
Comment 1 Andrew Clement CLA 2005-09-28 09:21:42 EDT
test and fixes checked in - waiting on build before closing.  
Test also verifies signature is "Ljava/lang/Object;LIE2;LIE1<Ljava/lang/String;>;"
Comment 2 Shawn Potter CLA 2005-09-28 18:06:37 EDT
I think I have encountered the same issue around using Declare Parent (I posted
a bunch of messages to the user list).

I encountered this problem with a 1.3.0 build of AJDT, but I had a new error
dialog after updating to:

Version: 1.3.0
Build id: 20050928171145
AspectJ version: 1.5.0.200509270946

Using:

Eclipse 3.1
Java 5 (Jrockit for running eclipse - project JDK sun Java 5)
Under Linux (Suse 9)

Here are the details of my null pointer exception:

java.lang.NullPointerException
at org.aspectj.weaver.ReferenceType.makeDeclaredSignature(ReferenceType.java:553)
at org.aspectj.weaver.ReferenceType.getSignatureForAttribute(ReferenceType.java:99)
at
org.aspectj.weaver.bcel.LazyClassGen.fixupGenericSignatureAttribute(LazyClassGen.java:547)
at org.aspectj.weaver.bcel.LazyClassGen.writeBack(LazyClassGen.java:478)
at org.aspectj.weaver.bcel.LazyClassGen.getJavaClass(LazyClassGen.java:600)
at org.aspectj.weaver.bcel.BcelWeaver.getClassFilesFor(BcelWeaver.java:1222)
at org.aspectj.weaver.bcel.BcelWeaver.weaveAndNotify(BcelWeaver.java:1195)
at org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeaver.java:1030)
at
org.aspectj.ajdt.internal.compiler.AjCompilerAdapter.weave(AjCompilerAdapter.java:299)
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:760)
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:120)
at
org.aspectj.ajde.internal.AspectJBuildManager$CompilerThread.run(AspectJBuildManager.java:191)

NullPointerException thrown: null

(In reply to comment #1)
> test and fixes checked in - waiting on build before closing.  
> Test also verifies signature is "Ljava/lang/Object;LIE2;LIE1<Ljava/lang/String;>;"

Comment 3 Andrew Clement CLA 2005-09-30 08:14:18 EDT
fix available in latest AJ dev build - will be in AJDT soon (monday?)