Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 374399

Summary: [validation] ArrayIndexOutOfBoundsException at org.eclipse.wst.jsdt.internal.compiler.ast.CaseStatement.resolveCase(CaseStatement.java:82)
Product: [WebTools] JSDT Reporter: Thomas Keller <me>
Component: WebAssignee: Project Inbox <jsdt.web-inbox>
Status: CLOSED DUPLICATE QA Contact: Nitin Dahyabhai <thatnitind>
Severity: normal    
Priority: P3 CC: fbricon, vrubezhny
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Thomas Keller CLA 2012-03-15 11:20:11 EDT
Build Identifier: Indigo, 20110916-0149

The JSDT moan about the following jQueryMobile 1.1 rc1 snippet:

switch ( d ) {
	case ".":
		break;
	case "..":
		if ( absStack.length ) {
			absStack.pop();
		}
		break;
	default:
        ^^^^^  the error is "The default case is already defined"
		absStack.push( d );
		break;
}

Eclipse brings up an error on every incremental build, which is blocking me quite a bit, because I have to click the error dialog hundreds of times a day. (No, unfortunately turning off Javascript validation did not help...)

Here is the complete stack trace:

Internal validation error java.lang.ArrayIndexOutOfBoundsException at 
 org.eclipse.wst.jsdt.internal.compiler.ast.CaseStatement.resolveCase(CaseStatement.java:82) at 
 org.eclipse.wst.jsdt.internal.compiler.ast.SwitchStatement.resolve(SwitchStatement.java:156) at 
 org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatements(AbstractMeth
 odDeclaration.java:350) at 
 org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclarati
 on.java:304) at 
 org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclarati
 on.java:375) at 
 org.eclipse.wst.jsdt.internal.compiler.ast.FunctionExpression.resolveType(FunctionExpression.java:
 58) 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.MessageSend.resolveType(MessageSend.java:279) at 
 org.eclipse.wst.jsdt.internal.compiler.ast.Expression.resolve(Expression.java:477) at 
 org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatements(AbstractMeth
 odDeclaration.java:350) at 
 org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclarati
 on.java:304) at 
 org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclarati
 on.java:375) at 
 org.eclipse.wst.jsdt.internal.compiler.ast.FunctionExpression.resolveType(FunctionExpression.java:
 58) 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.MessageSend.resolveType(MessageSend.java:279) at 
 org.eclipse.wst.jsdt.internal.compiler.ast.Expression.resolve(Expression.java:477) at 
 org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatements(AbstractMeth
 odDeclaration.java:350) at 
 org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclarati
 on.java:304) at 
 org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclarati
 on.java:375) at 
 org.eclipse.wst.jsdt.internal.compiler.ast.FunctionExpression.resolveType(FunctionExpression.java:
 58) at org.eclipse.wst.jsdt.internal.compiler.ast.MessageSend.resolveType(MessageSend.java:267) 
 at org.eclipse.wst.jsdt.internal.compiler.ast.Expression.resolve(Expression.java:477) at 
 org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatements(AbstractMeth
 odDeclaration.java:350) at 
 org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclarati
 on.java:304) at 
 org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclarati
 on.java:375) at 
 org.eclipse.wst.jsdt.internal.compiler.ast.FunctionExpression.resolveType(FunctionExpression.java:
 58) at org.eclipse.wst.jsdt.internal.compiler.ast.MessageSend.resolveType(MessageSend.java:279) 
 at org.eclipse.wst.jsdt.internal.compiler.ast.Expression.resolve(Expression.java:477) at 
 org.eclipse.wst.jsdt.internal.compiler.ast.CompilationUnitDeclaration.resolve(CompilationUnitDeclaratio
 n.java:394) at org.eclipse.wst.jsdt.internal.compiler.Compiler.process(Compiler.java:604) at 
 org.eclipse.wst.jsdt.internal.compiler.Compiler.compile(Compiler.java:356) 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:194) at 
 org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:728) 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:321) at 
 org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:396) at 
 org.eclipse.core.internal.resources.Project$1.run(Project.java:618) at 
 org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344) at 
 org.eclipse.core.internal.resources.Project.internalBuild(Project.java:597) at 
 org.eclipse.core.internal.resources.Project.build(Project.java:124) at 
 org.eclipse.wst.jsdt.internal.ui.util.CoreUtility$BuildJob.run(CoreUtility.java:159) at 
 org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)



Reproducible: Always
Comment 1 Fred Bricon CLA 2012-05-04 12:08:02 EDT
This is a duplicate of #376809
Comment 2 Nitin Dahyabhai CLA 2012-05-04 13:15:24 EDT

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