Bug 29113 - array initialization; ajc throws NullPointerException
Summary: array initialization; ajc throws NullPointerException
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 2000
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Jim Hugunin CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-01-07 16:11 EST by Doug Orleans CLA
Modified: 2003-01-07 18:17 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 Doug Orleans CLA 2003-01-07 16:11:28 EST
class Foo { }
aspect Bar {
  int[] Foo.bar = { 1, 2, 3 };
}

dro <830> % ajc Foo.java
java.lang.NullPointerException
	at org.eclipse.jdt.internal.compiler.codegen.CodeStream.newArray(Unknown Source)
	at org.eclipse.jdt.internal.compiler.ast.ArrayInitializer.generateCode(Unknown Source)
	at org.eclipse.jdt.internal.compiler.ast.QualifiedNameReference.generateAssignment(Unknown Source)
	at org.eclipse.jdt.internal.compiler.ast.Assignment.generateCode(Unknown Source)
	at org.eclipse.jdt.internal.compiler.ast.Expression.generateCode(Unknown Source)
	at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.generateCode(Unknown Source)
	at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.generateCode(Unknown Source)
	at org.aspectj.ajdt.internal.compiler.ast.InterTypeFieldDeclaration.generateCode(Unknown Source)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.generateCode(Unknown Source)
	at org.aspectj.ajdt.internal.compiler.ast.AspectDeclaration.generateCode(Unknown Source)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.generateCode(Unknown Source)
	at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.generateCode(Unknown Source)
	at org.eclipse.jdt.internal.compiler.Compiler.process(Unknown Source)
	at org.aspectj.ajdt.internal.compiler.AjCompiler.process(Unknown Source)
	at org.eclipse.jdt.internal.compiler.Compiler.compile(Unknown Source)
	at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(Unknown Source)
	at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(Unknown Source)
	at org.aspectj.ajdt.internal.core.builder.AjBuildManager$BatchBuilder.run(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)
/home/dougo/daj/test/array/Foo.java:0: Internal compiler error
java.lang.NullPointerException
	at org.eclipse.jdt.internal.compiler.codegen.CodeStream.newArray(Unknown Source)
	at org.eclipse.jdt.internal.compiler.ast.ArrayInitializer.generateCode(Unknown Source)
	at org.eclipse.jdt.internal.compiler.ast.QualifiedNameReference.generateAssignment(Unknown Source)
	at org.eclipse.jdt.internal.compiler.ast.Assignment.generateCode(Unknown Source)
	at org.eclipse.jdt.internal.compiler.ast.Expression.generateCode(Unknown Source)
	at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.generateCode(Unknown Source)
	at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.generateCode(Unknown Source)
	at org.aspectj.ajdt.internal.compiler.ast.InterTypeFieldDeclaration.generateCode(Unknown Source)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.generateCode(Unknown Source)
	at org.aspectj.ajdt.internal.compiler.ast.AspectDeclaration.generateCode(Unknown Source)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.generateCode(Unknown Source)
	at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.generateCode(Unknown Source)
	at org.eclipse.jdt.internal.compiler.Compiler.process(Unknown Source)
	at org.aspectj.ajdt.internal.compiler.AjCompiler.process(Unknown Source)
	at org.eclipse.jdt.internal.compiler.Compiler.compile(Unknown Source)
	at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(Unknown Source)
	at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(Unknown Source)
	at org.aspectj.ajdt.internal.core.builder.AjBuildManager$BatchBuilder.run(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)


!! no source information available !!
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.eclipse.jdt.internal.compiler.codegen.CodeStream.newArray(Unknown Source)
	at org.eclipse.jdt.internal.compiler.ast.ArrayInitializer.generateCode(Unknown Source)
	at org.eclipse.jdt.internal.compiler.ast.QualifiedNameReference.generateAssignment(Unknown Source)
	at org.eclipse.jdt.internal.compiler.ast.Assignment.generateCode(Unknown Source)
	at org.eclipse.jdt.internal.compiler.ast.Expression.generateCode(Unknown Source)
	at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.generateCode(Unknown Source)
	at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.generateCode(Unknown Source)
	at org.aspectj.ajdt.internal.compiler.ast.InterTypeFieldDeclaration.generateCode(Unknown Source)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.generateCode(Unknown Source)
	at org.aspectj.ajdt.internal.compiler.ast.AspectDeclaration.generateCode(Unknown Source)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.generateCode(Unknown Source)
	at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.generateCode(Unknown Source)
	at org.eclipse.jdt.internal.compiler.Compiler.process(Unknown Source)
	at org.aspectj.ajdt.internal.compiler.AjCompiler.process(Unknown Source)
	at org.eclipse.jdt.internal.compiler.Compiler.compile(Unknown Source)
	at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(Unknown Source)
	at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(Unknown Source)
	at org.aspectj.ajdt.internal.core.builder.AjBuildManager$BatchBuilder.run(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, 1 error
Comment 1 Jim Hugunin CLA 2003-01-07 18:17:25 EST
fixed in cvs, testcase in tests/bugs/InterFieldArray.java