Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 318387 - NPE in ConditionalExpression#resolveType()
Summary: NPE in ConditionalExpression#resolveType()
Status: RESOLVED WORKSFORME
Alias: None
Product: JSDT
Classification: WebTools
Component: General (show other bugs)
Version: 3.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.2.1   Edit
Assignee: Project Inbox CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-29 17:50 EDT by Wayne Beaton CLA
Modified: 2010-07-01 16:48 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wayne Beaton CLA 2010-06-29 17:50:13 EDT
I have a lot of the the latest bits from Helios loaded. Running on Ubuntu Linux. I'm presented with an error dialog every time I hit save. Here's the corresponding log entry.

-- Error Details --
Date: Tue Jun 29 17:15:27 EDT 2010
Message: Errors running builder 'JavaScript Validator' on project 'www'.
Severity: Error
Product: Eclipse 1.3.0.20100617-0521 (org.eclipse.epp.package.rcp.product)
Plugin: org.eclipse.wst.jsdt.core
Session Data:
eclipse.buildId=I20100608-0911
java.version=1.6.0_14
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_CA
Framework arguments:  -product org.eclipse.epp.package.rcp.product
Command-line arguments:  -os linux -ws gtk -arch x86 -product org.eclipse.epp.package.rcp.product


Exception Stack Trace:
java.lang.NullPointerException
	at org.eclipse.wst.jsdt.internal.compiler.ast.ConditionalExpression.resolveType(ConditionalExpression.java:195)
	at org.eclipse.wst.jsdt.internal.compiler.ast.ObjectLiteralField.resolveType(ObjectLiteralField.java:70)
	at org.eclipse.wst.jsdt.internal.compiler.ast.ObjectLiteral.resolveType(ObjectLiteral.java:80)
	at org.eclipse.wst.jsdt.internal.compiler.ast.ArrayInitializer.resolveTypeExpecting(ArrayInitializer.java:102)
	at org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration.resolve0(LocalDeclaration.java:228)
	at org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration.resolve(LocalDeclaration.java:129)
	at org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatements(AbstractMethodDeclaration.java:337)
	at org.eclipse.wst.jsdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:139)
	at org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:291)
	at org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:362)
	at org.eclipse.wst.jsdt.internal.compiler.ast.FunctionExpression.resolveType(FunctionExpression.java:57)
	at org.eclipse.wst.jsdt.internal.compiler.ast.Assignment.resolveType(Assignment.java:156)
	at org.eclipse.wst.jsdt.internal.compiler.ast.Expression.resolve(Expression.java:477)
	at org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatements(AbstractMethodDeclaration.java:337)
	at org.eclipse.wst.jsdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:139)
	at org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:291)
	at org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:362)
	at org.eclipse.wst.jsdt.internal.compiler.ast.FunctionExpression.resolveType(FunctionExpression.java:57)
	at org.eclipse.wst.jsdt.internal.compiler.ast.MessageSend.resolveType(MessageSend.java:246)
	at org.eclipse.wst.jsdt.internal.compiler.ast.Expression.resolve(Expression.java:477)
	at org.eclipse.wst.jsdt.internal.compiler.ast.CompilationUnitDeclaration.resolve(CompilationUnitDeclaration.java:394)
	at org.eclipse.wst.jsdt.internal.compiler.Compiler.process(Compiler.java:587)
	at org.eclipse.wst.jsdt.internal.compiler.Compiler.compile(Compiler.java:347)
	at org.eclipse.wst.jsdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:286)
	at org.eclipse.wst.jsdt.internal.core.builder.BatchImageBuilder.compile(BatchImageBuilder.java:86)
	at org.eclipse.wst.jsdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:225)
	at org.eclipse.wst.jsdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:58)
	at org.eclipse.wst.jsdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:291)
	at org.eclipse.wst.jsdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:199)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:629)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:172)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:203)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:255)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:258)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:311)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:343)
	at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:144)
	at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:242)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Comment 1 Wayne Beaton CLA 2010-06-29 23:57:32 EDT
My mistake. It happens on every workspace build. I had to remove the validation builder from the project to be able to get anything done. I'll try to run the workspace in debug sometime tomorrow to see if I can identify the what code it's stumbling over.
Comment 2 Chris Jaun CLA 2010-06-30 10:45:04 EDT
Do you have any sample source that reproduces this problem?
Comment 3 Wayne Beaton CLA 2010-06-30 14:36:17 EDT
From what I can tell, one of the YUI JS files that's causing trouble. I haven't had sufficient time to really understand what the code is doing, but the MethodDeclaration(AbstractMethodDeclaration).resolve(Scope) has the following value for "upperScope"

--- JavaScriptUnit Scope : /www/eclipse.org-common/yui/2.6.0/build/profilerviewer/profilerviewer-beta.js

You can obtain this file from the eclipse.org site:

http://www.eclipse.org/eclipse.org-common/yui/2.6.0/build/profilerviewer/profilerviewer-beta.js

I'll try to repeat this in a clean workspace.
Comment 4 Wayne Beaton CLA 2010-06-30 14:49:04 EDT
Ah. No joy initially. But I think I have an isolated example.

1) Create a new workspace
2) Create a new JavaScript project.
3) Drop http://www.eclipse.org/eclipse.org-common/yui/2.6.0/build/profilerviewer/profilerviewer-beta.js and http://www.eclipse.org/eclipse.org-common/yui/2.6.0/build/dragdrop/dragdrop.js into the project
4) Error occurs

The error did not occur initially with only the profileviewer-beta.js script in the project. It occurred immediately after adding the dragdrop.js script (thereby invoking the build).

The problem disappears when I remove the profileviewer-beta.js script. It then reappears if I re-add the file.

If I'm reading the stack trace correctly (which isn't guaranteed), I believe that it's line 698 in profilerviewer-beta.js that's causing the problem:

--
resizeable: (YAHOO.util.DragDrop) ? true : false,
--

HTH.

I can attach my workspace if you think that's valuable.
Comment 5 Chris Jaun CLA 2010-07-01 16:48:45 EDT
Error no longer occurs in 3.2.1.