Bug 318769 - NPE reported by the JS Validation Builder
Summary: NPE reported by the JS Validation Builder
Status: RESOLVED FIXED
Alias: None
Product: JSDT
Classification: WebTools
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal with 2 votes (vote)
Target Milestone: 3.2.2   Edit
Assignee: Chris Jaun CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2010-07-02 18:35 EDT by Antoine Toulmé CLA
Modified: 2011-06-02 10:36 EDT (History)
6 users (show)

See Also:
thatnitind: review+


Attachments
A plugin found in the CKEditor Drupal module (86.66 KB, application/javascript)
2010-08-11 06:02 EDT, Jack O'Connor CLA
no flags Details
Patch - adds a null check (883 bytes, patch)
2010-08-11 12:02 EDT, Chris Jaun CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antoine Toulmé CLA 2010-07-02 18:35:21 EDT
I get this NPE when running the build:

!ENTRY org.eclipse.core.resources 4 566 2010-07-02 15:31:49.454
!MESSAGE Errors occurred during the build.
!SUBENTRY 1 org.eclipse.wst.jsdt.core 4 75 2010-07-02 15:31:49.454
!MESSAGE Errors running builder 'JavaScript Validator' on project 'designer'.
!STACK 0
java.lang.NullPointerException
	at org.eclipse.wst.jsdt.internal.compiler.ast.ConditionalExpression.analyseCode(ConditionalExpression.java:50)
	at org.eclipse.wst.jsdt.internal.compiler.ast.ArrayInitializer.analyseCode(ArrayInitializer.java:42)
	at org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration.analyseCode(LocalDeclaration.java:62)
	at org.eclipse.wst.jsdt.internal.compiler.ast.Block.analyseCode(Block.java:48)
	at org.eclipse.wst.jsdt.internal.compiler.ast.IfStatement.analyseCode(IfStatement.java:91)
	at org.eclipse.wst.jsdt.internal.compiler.ast.MethodDeclaration.analyseCode(MethodDeclaration.java:93)
	at org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration.analyseCode(AbstractMethodDeclaration.java:108)
	at org.eclipse.wst.jsdt.internal.compiler.ast.FunctionExpression.analyseCode(FunctionExpression.java:73)
	at org.eclipse.wst.jsdt.internal.compiler.ast.ObjectLiteralField.analyseCode(ObjectLiteralField.java:78)
	at org.eclipse.wst.jsdt.internal.compiler.ast.ObjectLiteral.analyseCode(ObjectLiteral.java:97)
	at org.eclipse.wst.jsdt.internal.compiler.ast.MessageSend.analyseCode(MessageSend.java:86)
	at org.eclipse.wst.jsdt.internal.compiler.ast.FieldReference.analyseAssignment(FieldReference.java:91)
	at org.eclipse.wst.jsdt.internal.compiler.ast.Assignment.analyseCode(Assignment.java:59)
	at org.eclipse.wst.jsdt.internal.compiler.ast.CompilationUnitDeclaration.analyseCode(CompilationUnitDeclaration.java:155)
	at org.eclipse.wst.jsdt.internal.compiler.Compiler.process(Compiler.java:589)
	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:627)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:218)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:360)
	at org.eclipse.core.internal.resources.Project$1.run(Project.java:527)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
	at org.eclipse.core.internal.resources.Project.internalBuild(Project.java:507)
	at org.eclipse.core.internal.resources.Project.build(Project.java:99)
	at org.eclipse.debug.core.model.LaunchConfigurationDelegate$1.run(LaunchConfigurationDelegate.java:423)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1957)
	at org.eclipse.debug.core.model.LaunchConfigurationDelegate.buildProjects(LaunchConfigurationDelegate.java:430)
	at org.eclipse.debug.core.model.LaunchConfigurationDelegate.buildForLaunch(LaunchConfigurationDelegate.java:126)
	at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:821)
	at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:702)
	at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:923)
	at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1126)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

This is happening with JSDT 1.2.0 (I can't see the version in the BZ versions ?)
Comment 1 Chris Jaun CLA 2010-07-12 10:31:36 EDT
Steps to reproduce? Sample code?

I think this has been fixed in WTP 3.2.1.
Comment 2 Asaf Mesika CLA 2010-07-12 12:02:36 EDT
Got the exact issue as well.
Version of jsdt is 1.2.0
I'm reverting to 3.5 until this bug is fixed, since it renders Eclipse useless (stucks the workspace building)

Also, how can I install WTP 3.2.1 to see if this issue is resolved without downloading a full eclipse for it?
Comment 3 Chris Jaun CLA 2010-07-12 13:06:18 EDT
(In reply to comment #2)
> Got the exact issue as well.
> Version of jsdt is 1.2.0
> I'm reverting to 3.5 until this bug is fixed, since it renders Eclipse useless
> (stucks the workspace building)
> 
> Also, how can I install WTP 3.2.1 to see if this issue is resolved without
> downloading a full eclipse for it?

Would happily look into the problem if you could provide some steps to reproduce.

WTP 3.2.1 has not been released yet, so there is no update site for it.
Comment 4 Glen A. CLA 2010-07-23 04:41:48 EDT
I have the same issue. I'm really not sure how to reproduce it with a limited set of files.

When will WTP 3.2.1 be released? Can you not provide a pre-release build that we can use to test whether or not the issue has been fixed?
Comment 5 Nitin Dahyabhai CLA 2010-07-23 16:59:15 EDT
3.2.1 is due July 30th.  Maintenance builds toward that are posted weekly do our download page, http://eclipse.org/webtools/downloads/ .  As we're doing another release for Helios SR1, you won't find updated EPP packages for it.
Comment 6 Glen A. CLA 2010-07-24 05:06:06 EDT
I tried wtp-M-3.2.1-20100722005724.zip (installed via dropins), and the issue remains. Here are the log entries:

!ENTRY org.eclipse.core.resources 4 2 2010-07-24 10:59:39.667
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.core.resources".
!STACK 0
java.lang.NullPointerException
    at org.eclipse.wst.jsdt.internal.compiler.ast.ConditionalExpression.analyseCode(ConditionalExpression.java:50)
    at org.eclipse.wst.jsdt.internal.compiler.ast.ArrayInitializer.analyseCode(ArrayInitializer.java:42)
    at org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration.analyseCode(LocalDeclaration.java:62)
    at org.eclipse.wst.jsdt.internal.compiler.ast.Block.analyseCode(Block.java:48)
    at org.eclipse.wst.jsdt.internal.compiler.ast.IfStatement.analyseCode(IfStatement.java:91)
    at org.eclipse.wst.jsdt.internal.compiler.ast.MethodDeclaration.analyseCode(MethodDeclaration.java:93)
    at org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration.analyseCode(AbstractMethodDeclaration.java:108)
    at org.eclipse.wst.jsdt.internal.compiler.ast.MethodDeclaration.analyseCode(MethodDeclaration.java:91)
    at org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration.analyseCode(AbstractMethodDeclaration.java:108)
    at org.eclipse.wst.jsdt.internal.compiler.ast.FunctionExpression.analyseCode(FunctionExpression.java:73)
    at org.eclipse.wst.jsdt.internal.compiler.ast.Expression.analyseCode(Expression.java:184)
    at org.eclipse.wst.jsdt.internal.compiler.ast.MessageSend.analyseCode(MessageSend.java:65)
    at org.eclipse.wst.jsdt.internal.compiler.ast.CompilationUnitDeclaration.analyseCode(CompilationUnitDeclaration.java:155)
    at org.eclipse.wst.jsdt.internal.compiler.Compiler.process(Compiler.java:589)
    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)

!ENTRY org.eclipse.core.resources 4 75 2010-07-24 10:59:39.702
!MESSAGE Errors occurred during the build.
!SUBENTRY 1 org.eclipse.wst.jsdt.core 4 75 2010-07-24 10:59:39.702
!MESSAGE Errors running builder 'JavaScript Validator' on project 'insidenation.com v3'.
!STACK 0
java.lang.NullPointerException
    at org.eclipse.wst.jsdt.internal.compiler.ast.ConditionalExpression.analyseCode(ConditionalExpression.java:50)
    at org.eclipse.wst.jsdt.internal.compiler.ast.ArrayInitializer.analyseCode(ArrayInitializer.java:42)
    at org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration.analyseCode(LocalDeclaration.java:62)
    at org.eclipse.wst.jsdt.internal.compiler.ast.Block.analyseCode(Block.java:48)
    at org.eclipse.wst.jsdt.internal.compiler.ast.IfStatement.analyseCode(IfStatement.java:91)
    at org.eclipse.wst.jsdt.internal.compiler.ast.MethodDeclaration.analyseCode(MethodDeclaration.java:93)
    at org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration.analyseCode(AbstractMethodDeclaration.java:108)
    at org.eclipse.wst.jsdt.internal.compiler.ast.MethodDeclaration.analyseCode(MethodDeclaration.java:91)
    at org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration.analyseCode(AbstractMethodDeclaration.java:108)
    at org.eclipse.wst.jsdt.internal.compiler.ast.FunctionExpression.analyseCode(FunctionExpression.java:73)
    at org.eclipse.wst.jsdt.internal.compiler.ast.Expression.analyseCode(Expression.java:184)
    at org.eclipse.wst.jsdt.internal.compiler.ast.MessageSend.analyseCode(MessageSend.java:65)
    at org.eclipse.wst.jsdt.internal.compiler.ast.CompilationUnitDeclaration.analyseCode(CompilationUnitDeclaration.java:155)
    at org.eclipse.wst.jsdt.internal.compiler.Compiler.process(Compiler.java:589)
    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 7 Chris Jaun CLA 2010-08-10 16:56:02 EDT
Still unable to reproduce this with the information provided.

The code appears to be an array initializer containing a conditional expression.

Something like....

var b = 1;
var a = [b == 1 ? 1 : 2];

Just from the stack it is probably something with the condition statement that is causing this problem.
Comment 8 Jack O'Connor CLA 2010-08-11 06:02:03 EDT
Created attachment 176317 [details]
A plugin found in the CKEditor Drupal module
Comment 9 Jack O'Connor CLA 2010-08-11 06:04:22 EDT
OK Chris, as requested: steps to reproduce the NPE bug on Ubuntu 10.04

1) Download eclipse-php-helios-linux-gtk.tar.gz from Eclipse website (should have WTP 3.2.0)
2) Run it, create a new PHP project (check enable javascript support) and copy in the given file (it's called plugin.js)
3) Click project > clean, and after the clean it should do a build, which brings up a "Problem Occurred" popup, which says "'Building workspace' has encountered a problem"

I'm sorry I don't have time to find out exactly which part of the attached file is causing the problem.

If you need any more information, just let me know.
Comment 10 Glen A. CLA 2010-08-11 08:21:26 EDT
FYI: My project also contains CKEditor (v3.3.1 r5586).

I went through the code and the following parts may be the cause, according to Chris's comment:

// Part 1
tab = CKEDITOR.dom.element.createFromHtml( [
    '<a class="cke_dialog_tab"',
        ( this._.pageCount > 0 ? ' cke_last' : 'cke_first' ),
        titleHtml,
        ( !!contents.hidden ? ' style="display:none"' : '' ),
        ' id="', tabId, '"',
        env.gecko && env.version >= 10900 && !env.hc ? '' : ' href="javascript:void(0)"',
        ' tabIndex="-1"',
        ' hidefocus="true"',
        ' role="tab">',
            contents.label,
    '</a>'
].join( '' ) );

// Part 2
this.parts.dialog[ ( this._.pageCount === 1 ? 'add' : 'remove' ) + 'Class' ]( 'cke_single_page' );

// Part 3
var html = [
        '<div style="position: ', ( CKEDITOR.env.ie6Compat ? 'absolute' : 'fixed' ),
        '; z-index: ', baseFloatZIndex,
        '; top: 0px; left: 0px; ',
        ( !CKEDITOR.env.ie6Compat ? 'background-color: ' + backgroundColorStyle : '' ),
        '" class="cke_dialog_background_cover">'
    ];

// Part 4
keyProcessor = accessKeyProcessors[( ctrl ? 'CTRL+' : '' ) + ( alt ? 'ALT+' : '') + ( shift ? 'SHIFT+' : '' ) + key];

Hope this helps.
Comment 11 Chris Jaun CLA 2010-08-11 09:32:30 EDT
Thanks for the updates. I will look into this today.
Comment 12 Chris Jaun CLA 2010-08-11 12:02:25 EDT
Created attachment 176374 [details]
Patch - adds a null check
Comment 13 Chris Jaun CLA 2010-08-11 14:59:37 EDT
Fix checked into 3.2.2. and HEAD.
Comment 14 Jack O'Connor CLA 2010-08-12 07:06:26 EDT
I tried installing 3.2.2 and I still get the error. I narrowed the problem code down, and simplified it to this line, which still gives me the NPE when building:

var a = [b, ( !c ? '' : '' )];

TBH I'm not completely sure I installed 3.2.2 properly. This is what I did:
1) Extract eclipse-php-helios-linux-gtk.tar.gz to create a clean eclipse install (with WTP 3.2.0)
2) Go to http://build.eclipse.org/webtools/committers/ and click 3.2.2 at the top, scroll down to section "Traditional Zip Files for Web Tools Platform", and download the WTP zip
3) Extract the contents and copy the 2 directories (plugins and features) into my main eclipse directory (involved clicking "merge all", then "replace all")
4) Run eclipse with the -clean option

If I go Help > About and click the WTP icon, for Feature Name = Eclipse Web Developer Tools, it says Version 3.2.2. But I notice that for Feature Name = Eclipse JavaScript Development Tools, it says Version 1.2.1.
Comment 15 Glen A. CLA 2010-08-12 07:41:13 EDT
Jack, as far as I know, there hasn't been a 3.2.2 build since Chris committed the fix (the last build was on the 10th).
Comment 16 Jack O'Connor CLA 2010-08-12 08:04:43 EDT
Ooops! You're right - the 3.2.2 I got was built on the 10th so couldn't possibly contain the fix. Still, perhaps my isolating the problem code will be useful for testing. Hopefully someone will post here when there is a new build...
Comment 17 Glen A. CLA 2010-08-13 16:55:41 EDT
I just installed the latest 3.2.2 maintenance build (wtp-M-3.2.2-20100812190430.zip
), and I get an exception in a different area now:

!ENTRY org.eclipse.core.resources 4 2 2010-08-13 22:44:57.500
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.core.resources".
!STACK 0
java.lang.NullPointerException
	at org.eclipse.wst.jsdt.internal.compiler.flow.UnconditionalFlowInfo.markAsDefinitelyNonNull(UnconditionalFlowInfo.java:1186)
	at org.eclipse.wst.jsdt.internal.compiler.ast.FieldReference.analyseAssignment(FieldReference.java:80)
	at org.eclipse.wst.jsdt.internal.compiler.ast.Assignment.analyseCode(Assignment.java:61)
	at org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration.analyseCode(LocalDeclaration.java:62)
	at org.eclipse.wst.jsdt.internal.compiler.ast.CompilationUnitDeclaration.analyseCode(CompilationUnitDeclaration.java:155)
	at org.eclipse.wst.jsdt.internal.compiler.Compiler.process(Compiler.java:589)
	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:194)
	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)

!ENTRY org.eclipse.core.resources 4 75 2010-08-13 22:44:57.597
!MESSAGE Errors occurred during the build.
!SUBENTRY 1 org.eclipse.wst.jsdt.core 4 75 2010-08-13 22:44:57.597
!MESSAGE Errors running builder 'JavaScript Validator' on project '...'.
!STACK 0
java.lang.NullPointerException
	at org.eclipse.wst.jsdt.internal.compiler.flow.UnconditionalFlowInfo.markAsDefinitelyNonNull(UnconditionalFlowInfo.java:1186)
	at org.eclipse.wst.jsdt.internal.compiler.ast.FieldReference.analyseAssignment(FieldReference.java:80)
	at org.eclipse.wst.jsdt.internal.compiler.ast.Assignment.analyseCode(Assignment.java:61)
	at org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration.analyseCode(LocalDeclaration.java:62)
	at org.eclipse.wst.jsdt.internal.compiler.ast.CompilationUnitDeclaration.analyseCode(CompilationUnitDeclaration.java:155)
	at org.eclipse.wst.jsdt.internal.compiler.Compiler.process(Compiler.java:589)
	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:194)
	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)
!SESSION 2010-08-13 22:48:29.292 -----------------------------------------------
eclipse.buildId=I20100608-0911
java.version=1.6.0_20
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_ZA
Command-line arguments:  -os win32 -ws win32 -arch x86
Comment 18 Chris Jaun CLA 2010-08-13 17:16:31 EDT
(In reply to comment #17)
> I just installed the latest 3.2.2 maintenance build
> (wtp-M-3.2.2-20100812190430.zip
> ), and I get an exception in a different area now:
> 
> !ENTRY org.eclipse.core.resources 4 2 2010-08-13 22:44:57.500
> !MESSAGE Problems occurred when invoking code from plug-in:
> "org.eclipse.core.resources".
> !STACK 0
> java.lang.NullPointerException
>     at
> 

That bug is not related to this one.
Comment 20 Glen A. CLA 2010-08-14 03:15:42 EDT
Thanks Chris.
Comment 21 Asaf Mesika CLA 2010-12-01 05:00:25 EST
Guys, I've found a workaround!
The javascript validation exception is solved by turning on the checkbox: Preferences->Validator->Errors/Warnings/"Enable JavaScript semantic validation".

Tell me if it also worked for you as well.
Comment 22 Asaf Mesika CLA 2011-02-10 07:29:34 EST
The error still occurs in 3.2.2.
I have Version: Helios Service Release 1 Build id: 20100917-0705, which contains JavaScript Development Tools Version: 1.2.2.v201008170101-7C78FGMF9JgLWLMUUEMtXc
Build id: 20100915173744.

Here's the stack trace:


eclipse.buildId=M20100909-0800
java.version=1.6.0_12
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.jee.product


Error
Thu Feb 10 14:11:37 IST 2011
Errors running builder 'JavaScript Validator' on project 'foo-2.5'.

java.lang.NullPointerException
at org.eclipse.wst.jsdt.internal.compiler.ast.ConditionalExpression.analyseCode(ConditionalExpression.java:50)
at org.eclipse.wst.jsdt.internal.compiler.ast.ArrayInitializer.analyseCode(ArrayInitializer.java:42)
at org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration.analyseCode(LocalDeclaration.java:62)
at org.eclipse.wst.jsdt.internal.compiler.ast.Block.analyseCode(Block.java:48)
at org.eclipse.wst.jsdt.internal.compiler.ast.IfStatement.analyseCode(IfStatement.java:91)
at org.eclipse.wst.jsdt.internal.compiler.ast.MethodDeclaration.analyseCode(MethodDeclaration.java:93)
at org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration.analyseCode(AbstractMethodDeclaration.java:108)
at org.eclipse.wst.jsdt.internal.compiler.ast.FunctionExpression.analyseCode(FunctionExpression.java:73)
at org.eclipse.wst.jsdt.internal.compiler.ast.ObjectLiteralField.analyseCode(ObjectLiteralField.java:78)
at org.eclipse.wst.jsdt.internal.compiler.ast.ObjectLiteral.analyseCode(ObjectLiteral.java:97)
at org.eclipse.wst.jsdt.internal.compiler.ast.MessageSend.analyseCode(MessageSend.java:86)
at org.eclipse.wst.jsdt.internal.compiler.ast.FieldReference.analyseAssignment(FieldReference.java:91)
at org.eclipse.wst.jsdt.internal.compiler.ast.Assignment.analyseCode(Assignment.java:61)
at org.eclipse.wst.jsdt.internal.compiler.ast.CompilationUnitDeclaration.analyseCode(CompilationUnitDeclaration.java:155)
at org.eclipse.wst.jsdt.internal.compiler.Compiler.process(Compiler.java:589)
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:194)
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.resources.Workspace.build(Workspace.java:344)
at org.eclipse.wst.jsdt.internal.ui.util.CoreUtility$BuildJob.run(CoreUtility.java:150)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Comment 23 Matt CLA 2011-04-05 13:30:43 EDT
I'm still getting this same error, and I have the following installed:

Eclipse Web Developer Tools	3.2.3.v201102160541-7O7CFbWEMf84qYjGDyP3DNEwcgFU
JavaScript Development Tools	1.2.3.v201102160540-7C78FGUF9JgLWNO2UCNqfa

Is the target milestone incorrect?

Thanks!