Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 313327 - [validation] JavaScript Validator builder fails (ArrayIndexOutOfBoundsException)
Summary: [validation] JavaScript Validator builder fails (ArrayIndexOutOfBoundsException)
Status: CLOSED DUPLICATE of bug 317833
Alias: None
Product: JSDT
Classification: WebTools
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: 3.2.2   Edit
Assignee: Project Inbox CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2010-05-18 07:19 EDT by Marijn CLA
Modified: 2010-08-11 13:26 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marijn CLA 2010-05-18 07:19:07 EDT
I get the error shown below when my project is building. Copying the JavaScript files to a clean project doesn't reproduce the error. I therefore can't seem to reproduce the problem in a clean environment. I am running PDT 2.2M7.

-- Error Details --
Date: Tue May 18 12:37:45 CEST 2010
Message: Errors running builder 'JavaScript Validator' on project '***'.
Severity: Error
Product: Eclipse 1.3.0.20100427-1120 (org.eclipse.epp.package.php.product)
Plugin: org.eclipse.wst.jsdt.core
Exception Stack Trace:
java.lang.ArrayIndexOutOfBoundsException: 1
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:59)
at org.eclipse.wst.jsdt.internal.compiler.ast.CompilationUnitDeclaration.analyseCode(CompilationUnitDeclaration.java:162)
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)
Comment 1 Chris Jaun CLA 2010-05-18 14:13:36 EDT
There is not enough information included in this bug report for us to investigate.

Please provide steps to reproduce and some sample JavaScript files.

Also, can you check which version of the org.eclipse.wst.jsdt.core plugin you are using?
Comment 2 Marijn CLA 2010-05-19 06:01:21 EDT
As noted in my original report, I can't create a reproducable situation.

After some extensive testing I've been able to reproduce it in a clean environment, but it seems like the error is produced due to a combination of events occuring, and not by a specific piece of code. Due to the propriatary nature of the project involved, I am unable to post the whole here. My narrowed down piece still covers nearly 1000 lines of code, and it's getting increasingly hard to remove lines while still having the builder break, so I don't have much hope that even if I can narrow it down futher, I'll be able to build a sample file.

The version of the the plugin is org.eclipse.wst.jsdt.core_1.1.0.v201004290253.

Are there not instructions somewhere that could guide me on how to debug an error like this myself?

Regards,

Marijn.
Comment 3 Chris Jaun CLA 2010-05-20 10:16:06 EDT
Hi Marijn,

The way I would start debugging this would be to set a breakpoint at line 1186 in UnconditionalFlowInfo to catch the case where the NPE occurs and then I try to work my way back to see how it got in that state.

I don't have any specific documentation on debugging JSDT.

If you start looking and have questions post them here and I can help point you in the right way.

Chris
Comment 4 Marijn CLA 2010-05-20 10:33:28 EDT
Hi Chris,

Actually I meant some documentation on how to debug an Eclipse plugin in general. I haven't used Eclipse in a while, and it's maybe two years ago since I last debugged a plugin.

From what I remember I needed to make a checkout (but maybe that was another plugin) from CVS, and eventually ended up with two Eclipse sessions, one for running the plugin in a "normal" environment, and one for development and debugging of the plugin in question. As I recall it was all fairly easy to setup, but I just can't remember how :(.

Regards,

Marijn.
Comment 5 Chris Jaun CLA 2010-05-24 10:28:00 EDT
You will need to check out the plugin org.eclipse.wst.jsdt.core into your workspace.

CVS: dev.eclipse.org:/cvsroot/webtools - use pserver

Then you will need to launch a runtime workspace in Debug mode.

Go to Run -> Debug Configurations

Create a new Eclipse Application.

Hit debug and you should be good to go.
Comment 6 Marijn CLA 2010-06-08 06:21:24 EDT
Took a while before I got the time to setup the debugging.

Well this.extra is null when the exception occurs (that much was probably obvious), but (this part of) the code isn't really self-explanatory for me if you don't know what it does.

I find some comments for states where extra === null which said "// if vector not yet allocated, then not initialized". From that would I be correct to infer that it means the markAsDefinitelyNonNull was called while the instance was not yet fully initialized, i.e. that no (proper) call was made yet to addInitializationsFrom() ?
Comment 7 Roy Ganor CLA 2010-07-29 02:58:19 EDT
Not sure if it is related but one of the PDT users also complaints on this exception thrown at the exact same line with NPE:

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:59)
	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.SingleNameReference.analyseAssignment(SingleNameReference.java:80)
	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: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 8 Chris Jaun CLA 2010-08-11 13:26:19 EDT
Marking this one as a duplicate because the other bug has information on how to reproduce.

*** This bug has been marked as a duplicate of bug 317833 ***