Community
Participate
Working Groups
java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1 at org.eclipse.jdt.internal.compiler.codegen.CodeStream.lookupswitch(CodeStream.java:6330) at org.eclipse.jdt.internal.compiler.ast.SwitchStatement.generateCode(SwitchStatement.java:529) at org.eclipse.jdt.internal.compiler.ast.Block.generateCode(Block.java:88) at org.eclipse.jdt.internal.compiler.ast.ForStatement.generateCode(ForStatement.java:325) at org.eclipse.jdt.internal.compiler.ast.Block.generateCode(Block.java:88) at org.eclipse.jdt.internal.compiler.ast.IfStatement.generateCode(IfStatement.java:205) at org.eclipse.jdt.internal.compiler.ast.Block.generateCode(Block.java:88) at org.eclipse.jdt.internal.compiler.ast.TryStatement.generateCode(TryStatement.java:586) at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.generateCode(AbstractMethodDeclaration.java:354) at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.generateCode(AbstractMethodDeclaration.java:291) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.generateCode(TypeDeclaration.java:742) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.generateCode(TypeDeclaration.java:812) at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.generateCode(CompilationUnitDeclaration.java:408) at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:913) at org.eclipse.jdt.internal.compiler.ProcessTaskManager.run(ProcessTaskManager.java:145) at java.base/java.lang.Thread.run(Thread.java:832)
Hello, I have installed Eclipse 4.19m3 & rc1 and receive compile errors ... It seems JDT is not able to compile switch anymore. I run Eclipse with OpenJDK 15.0.2 Thanks! Regards Alex
Can you please post a sample code to reproduce this error?
Hi, it happens in all my Workspace where there is switch statement ... here a sample .. public class Test { public static void main(String[] args) { String value = "A"; switch (value) { case "A": System.out.println("Test"); break; } } }
Are you sure you *really* use 4.19 Eclipse? That bug was fixed and should be only there if you still using 4.18 JDT.
Yes, here the build information Eclipse SDK Version: 2021-03 (4.19) Build id: I20210224-1800 OS: Linux, v.5.8.0-44-generic, x86_64 / gtk 3.24.20 Java version: 15.0.2 I received these errors 4.19m1 (on Windows) and now with 4.19rc1 on my Linux PC.
I am not able to reproduce this error using the given test case. @Andrey: can you? @Alex: Can you please create a small test project and attach - to check whether any compiler options has any effect?
Yesterday I changed some compile options in order to trigger a rebuild process and it worked. Now I am also not able to reproduce the errors ...
Created attachment 285698 [details] Sample project
Errors again after checking out some other projects from my SVN. When I created a new project, it seems Eclipse thinks I using an old compile level (eg. 1.4) I use workspace compile options: 15 with Enabled preview features for Java 15. I seems to work after a full build.
(In reply to Missing name from comment #8) > Created attachment 285698 [details] > Sample project Thanks Alex for Sample Project - However, I don't get this error with Eclipse Version: 2021-03 (4.19) Build id: I20210209-1800 and Java 15 as the compiler that gets used with 1.7 What I have done is to use File->Import -> Existing Projects in Workspace -> <Zip> and I don't see the error. Should I be following a different set of steps for reproducing the issue with the Zip file?
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.