Bug 30280 - NullPointerException at org.eclipse.jdt.internal.compiler.ast.QualifiedAllocationExpression.resolveType(QualifiedAllocationExpression.java:225)
Summary: NullPointerException at org.eclipse.jdt.internal.compiler.ast.QualifiedAlloca...
Status: CLOSED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.1 M5   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-01-27 08:01 EST by Francis ANDRE CLA
Modified: 2003-02-11 03:18 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 Francis ANDRE CLA 2003-01-27 08:01:11 EST
Hi there

I have no idea of what special is the build I am dooing except that java source 
files are quite large.

!ENTRY org.eclipse.core.resources 2 75 janv. 27, 2003 14:27:07.656
!MESSAGE Errors during build.
!SUBENTRY 1 org.eclipse.jdt.core 2 75 janv. 27, 2003 14:27:07.656
!MESSAGE java.lang.NullPointerException encountered while running 
org.eclipse.jdt.internal.core.builder.JavaBuilder.
!STACK 0
java.lang.NullPointerException
	at 
org.eclipse.jdt.internal.compiler.ast.QualifiedAllocationExpression.resolveType
(QualifiedAllocationExpression.java:225)
	at org.eclipse.jdt.internal.compiler.ast.LocalDeclaration.resolve
(LocalDeclaration.java:196)
	at org.eclipse.jdt.internal.compiler.ast.Block.resolve(Block.java:92)
	at org.eclipse.jdt.internal.compiler.ast.IfStatement.resolve
(IfStatement.java:243)
	at org.eclipse.jdt.internal.compiler.ast.Block.resolve(Block.java:92)
	at org.eclipse.jdt.internal.compiler.ast.ForStatement.resolve
(ForStatement.java:283)
	at 
org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatement
s(AbstractMethodDeclaration.java:377)
	at 
org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements
(MethodDeclaration.java:68)
	at 
org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve
(AbstractMethodDeclaration.java:366)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve
(TypeDeclaration.java:886)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve
(TypeDeclaration.java:913)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve
(TypeDeclaration.java:875)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve
(TypeDeclaration.java:920)
	at 
org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.resolve
(CompilationUnitDeclaration.java:235)
	at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:537)
	at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:337)
	at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile
(AbstractImageBuilder.java:194)
	at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile
(AbstractImageBuilder.java:144)
	at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build
(BatchImageBuilder.java:49)
	at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll
(JavaBuilder.java:179)
	at org.eclipse.jdt.internal.core.builder.JavaBuilder.build
(JavaBuilder.java:107)
	at org.eclipse.core.internal.events.BuildManager$2.run
(BuildManager.java:384)
	at org.eclipse.core.internal.runtime.InternalPlatform.run
(InternalPlatform.java:852)
	at org.eclipse.core.runtime.Platform.run(Platform.java:413)
	at org.eclipse.core.internal.events.BuildManager.basicBuild
(BuildManager.java:120)
	at org.eclipse.core.internal.events.BuildManager.basicBuild
(BuildManager.java:176)
	at org.eclipse.core.internal.events.BuildManager.basicBuild
(BuildManager.java:186)
	at org.eclipse.core.internal.events.BuildManager$1.run
(BuildManager.java:146)
	at org.eclipse.core.internal.runtime.InternalPlatform.run
(InternalPlatform.java:852)
	at org.eclipse.core.runtime.Platform.run(Platform.java:413)
	at org.eclipse.core.internal.events.BuildManager.basicBuild
(BuildManager.java:160)
	at org.eclipse.core.internal.events.BuildManager.build
(BuildManager.java:211)
	at org.eclipse.core.internal.resources.Workspace.endOperation
(Workspace.java:861)
	at org.eclipse.core.internal.resources.Workspace.run
(Workspace.java:1569)
	at org.eclipse.ui.actions.WorkspaceModifyOperation.run
(WorkspaceModifyOperation.java:79)
	at org.eclipse.jface.operation.ModalContext.runInCurrentThread
(ModalContext.java:296)
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:246)
	at org.eclipse.jface.dialogs.ProgressMonitorDialog.run
(ProgressMonitorDialog.java:351)
	at 
org.eclipse.jdt.internal.ui.preferences.BuildPathsPropertyPage.performOk
(BuildPathsPropertyPage.java:154)
	at org.eclipse.jface.preference.PreferenceDialog.okPressed
(PreferenceDialog.java:616)
	at org.eclipse.jface.preference.PreferenceDialog.buttonPressed
(PreferenceDialog.java:185)
	at org.eclipse.jface.dialogs.Dialog$1.widgetSelected(Dialog.java:398)
	at org.eclipse.swt.widgets.TypedListener.handleEvent
(TypedListener.java:87)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:77)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:825)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1692)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1410)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:561)
	at org.eclipse.jface.window.Window.open(Window.java:541)
	at org.eclipse.ui.dialogs.PropertyDialogAction.run
(PropertyDialogAction.java:158)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:769)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection
(ActionContributionItem.java:411)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent
(ActionContributionItem.java:365)
	at org.eclipse.jface.action.ActionContributionItem.access$0
(ActionContributionItem.java:356)
	at 
org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent
(ActionContributionItem.java:48)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:77)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:825)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1692)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1410)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1446)
	at org.eclipse.ui.internal.Workbench.run(Workbench.java:1429)
	at org.eclipse.core.internal.boot.InternalBootLoader.run
(InternalBootLoader.java:845)
	at org.eclipse.core.boot.BootLoader.run(BootLoader.java:462)
	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:324)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:247)
	at org.eclipse.core.launcher.Main.run(Main.java:703)
	at org.eclipse.core.launcher.Main.main(Main.java:539)
Comment 1 Philipe Mulet CLA 2003-01-27 08:26:44 EST
Which build are you running ? Any testcase to reproduce ?
Comment 2 Philipe Mulet CLA 2003-01-27 08:39:58 EST
Also, are you running Eclipse on IBM JRE 1.3.1 ? The stack trace below 
shouldn't occur if it comes from 20030122, unless the VM has a bug (the binding 
couldn't be null there, and even if it was, it should have failed a couple 
lines above).

if ((this.binding = scope.getConstructor(...)).isValidBinding()) {
  ...
} else {
	if (this.binding.declaringClass == null) // NPE HERE !?
		this.binding.declaringClass = (ReferenceBinding) receiverType;
	scope.problemReporter().invalidConstructor(this, this.binding);
	return receiverType;
}
Comment 3 Francis ANDRE CLA 2003-01-28 13:06:28 EST
Hello

I am running Eclipse 2.1 Build id: 200212181304 with the Sun JDK 1.4.1_02.
I was not able to reproduce or reduce the scope of such case until now.
I will check again soon.

Regards

Comment 4 Philipe Mulet CLA 2003-01-29 04:28:58 EST
Thanks for clarification, then the offending line is:

   if (!receiverType.canBeInstantiated()) {

will investigate.
Comment 5 Philipe Mulet CLA 2003-01-29 04:33:48 EST
Reproduced:

public class X {
	class Y {}
	public static void main(String[] arguments) {
		int i = 0;
		i.new Y();	
	} 
}
Comment 6 Philipe Mulet CLA 2003-01-29 04:37:59 EST
Fixed
Comment 7 David Audel CLA 2003-02-10 12:37:50 EST
Verified.
Comment 8 Francis ANDRE CLA 2003-02-11 03:18:06 EST
Closed in Eclipse M5