Bug 115038 - NPE in ensureScopeSetup(..) on type parm in ITD - expected error
Summary: NPE in ensureScopeSetup(..) on type parm in ITD - expected error
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.5.0M4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 1.5.0RC1   Edit
Assignee: Andrew Clement CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-04 04:25 EST by Wes Isberg CLA
Modified: 2005-11-09 02:45 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 Wes Isberg CLA 2005-11-04 04:25:43 EST
Compiling the following produces a BCException rather than a compiler error:

------------------------------------------------------------
public abstract aspect AObserver<Observable, Observer, Event> {
	public boolean Observer.handle(Observable o, Event e) {
		return true;
	}
}
------------------------------------------------------------
when collecting itds and declares AObserver
when completing type bindings 
when batch building with classpath:
c:\home\apps\jdk15\jre\lib\ext\dnsns.jar;c:\home\apps\jdk15\jre\lib\ext\localedata.jar;c:\home\apps\jdk15\jre\lib\ext\sunjce_provider.jar;c:\home\apps\jdk15\jre\lib\ext\sunpkcs11.jar;C:\home\apps\aspectj-1.5\lib\aspectjrt.jar;
null
java.lang.NullPointerException
	at
org.aspectj.ajdt.internal.compiler.ast.InterTypeDeclaration.ensureScopeSetup(InterTypeDeclaration.java:361)
	at
org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.resolveTypesFor(SourceTypeBinding.java:1279)
	at
org.aspectj.ajdt.internal.compiler.ast.InterTypeMethodDeclaration.build(InterTypeMethodDeclaration.java:175)
	at
org.aspectj.ajdt.internal.compiler.ast.AspectDeclaration.buildInterTypeAndPerClause(AspectDeclaration.java:1053)
	at
org.aspectj.ajdt.internal.compiler.lookup.AjLookupEnvironment.buildInterTypeAndPerClause(AjLookupEnvironment.java:427)
	at
org.aspectj.ajdt.internal.compiler.lookup.AjLookupEnvironment.collectAllITDsAndDeclares(AjLookupEnvironment.java:311)
	at
org.aspectj.ajdt.internal.compiler.lookup.AjLookupEnvironment.completeTypeBindings(AjLookupEnvironment.java:166)
	at
org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.beginToCompile(Compiler.java:301)
	at
org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:315)
	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.ajdt.ajc.AjdtCommand.doCommand(AjdtCommand.java:112)
	at org.aspectj.ajdt.ajc.AjdtCommand.runCommand(AjdtCommand.java:60)
	at org.aspectj.tools.ajc.Main.run(Main.java:326)
	at org.aspectj.tools.ajc.Main.runMain(Main.java:240)
	at org.aspectj.tools.ajc.Main.main(Main.java:83)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.aspectj.tools.ajbrowser.Main.compilerMain(Main.java:55)
	at org.aspectj.tools.ajbrowser.Main.main(Main.java:32)
Comment 1 Wes Isberg CLA 2005-11-04 04:27:12 EST
Sorry, meant to say you get the BCException in addition to a compiler error.
Comment 2 Andrew Clement CLA 2005-11-04 04:34:37 EST
darn itds.
Comment 3 Andrew Clement CLA 2005-11-04 12:32:17 EST
I've fixed the NPE - it now surfaces one message I do like and two that I don't
(theres a similar test producing the extraneous messages in the suite and I
marked it as a TODO when I created that test that we ought to remove them at
some point in the future) - I think removing the NPE could be sufficient for 1.5.0.

public boolean Observer.handle(Observable o, Event e) {
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
C:\temp\ajcSandbox\ajcTest62104.tmp\pr115038.aj:2:0::0 Cannot make inter-type
declarations on type variables, use an interface and declare parents
public boolean Observer.handle(Observable o, Event e) {
                               ^^^^^^^^
C:\temp\ajcSandbox\ajcTest62104.tmp\pr115038.aj:2:0::0 Cannot make a static
reference to the non-static type Observable

public boolean Observer.handle(Observable o, Event e) {
                                             ^^^
C:\temp\ajcSandbox\ajcTest62104.tmp\pr115038.aj:2:0::0 Cannot make a static
reference to the non-static type Event

fix checked in.
Comment 4 Andrew Clement CLA 2005-11-08 06:08:45 EST
rogue error messages removed.  fix checked in - will close when build available.
Comment 5 Andrew Clement CLA 2005-11-09 02:45:16 EST
fix available.