Bug 417894 - Errors running builder 'JavaScript Validator; java.lang.String constant cannot be casted into int
Summary: Errors running builder 'JavaScript Validator; java.lang.String constant canno...
Status: NEW
Alias: None
Product: JSDT
Classification: WebTools
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Chris Jaun CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-24 05:54 EDT by Peter Fischaleck CLA
Modified: 2015-11-24 16:48 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Fischaleck CLA 2013-09-24 05:54:38 EDT
Hi there!
I encountered the following Errormessage:

Errors occurred during the build.
Errors running builder 'JavaScript Validator' on project 'XXXXX'.
java.lang.String constant cannot be casted into int

The problem was some code that was in my javascript file by mistake, it is reducable to the following:

<code begins here>
+ +""  
<code ends here>

the problem does not occur, with ++"" , only if a space or a newline follows the first +

Bye!
Peter
Comment 1 Peter Fischaleck CLA 2013-09-24 06:31:03 EDT
Additional Info:

Version:

Eclipse Java EE IDE for Web Developers.

Version: Kepler Release
Build id: 20130614-0229

The same problem happened on a prior release, I deleted that version though and don't know its Build id.

The following Info is displayed when hovering the mouse over the first line of the file containing 
+ +""

Internal validation error org.eclipse.wst.jsdt.internal.compiler.problem.ShouldNotImplement: java.lang.String 
 constant cannot be casted into int at org.eclipse.wst.jsdt.internal.compiler.impl.Constant.intValue(Constant.java:
 1283) at org.eclipse.wst.jsdt.internal.compiler.impl.Constant.computeConstantOperationPLUS(Constant.java:
 1005) at org.eclipse.wst.jsdt.internal.compiler.impl.Constant.computeConstantOperation(Constant.java:192) at 
 org.eclipse.wst.jsdt.internal.compiler.ast.UnaryExpression.resolveType(UnaryExpression.java:139) 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:607) at 
 org.eclipse.wst.jsdt.internal.compiler.Compiler.compile(Compiler.java:355) at 
 org.eclipse.wst.jsdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:288) 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:227) 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:726) at 
 org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at 
 org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199) at 
 org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239) at 
 org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292) at 
 org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at 
 org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295) at 
 org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:351) at 
 org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:374) at 
 org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143) at 
 org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241) at 
 org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Comment 2 Jacob Lifshay CLA 2015-11-24 16:46:22 EST
Creating an empty project with a single file containing the single line:
-+'';

triggers the same bug.
Comment 3 Jacob Lifshay CLA 2015-11-24 16:48:01 EST
I encountered the same problem on Eclipse Mars:

  JavaScript Development Tools	1.6.201.v201508262249	org.eclipse.wst.jsdt.feature.feature.group	Eclipse Web Tools Platform