Skip to content

IndexOutOfBounds on save and create new class #205

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dsyer opened this issue Jul 7, 2020 · 1 comment
Closed

IndexOutOfBounds on save and create new class #205

dsyer opened this issue Jul 7, 2020 · 1 comment

Comments

@dsyer
Copy link

dsyer commented Jul 7, 2020

Error occurs on save and (slightly different stack trace) when you try to create a new Java class file. The latter is a showstopper because it prevents the file from being created. This is from a fresh install of Eclipse 2020-06 plus the Spring plugin:

java.lang.IndexOutOfBoundsException: Index 32 out of bounds for length 32
	at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
	at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
	at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248)
	at java.base/java.util.Objects.checkIndex(Objects.java:372)
	at java.base/java.util.ArrayList.get(ArrayList.java:458)
	at io.spring.javaformat.formatter.eclipse.TokenManager.get(TokenManager.java:75)
	at io.spring.javaformat.formatter.eclipse.TokenManager.findIndex(TokenManager.java:168)
	at io.spring.javaformat.formatter.eclipse.SpacePreparator.handleToken(SpacePreparator.java:1098)
	at io.spring.javaformat.formatter.eclipse.SpacePreparator.visit(SpacePreparator.java:178)
	at org.eclipse.jdt.core.dom.TypeDeclaration.accept0(TypeDeclaration.java:430)
	at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2971)
	at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:3042)
	at org.eclipse.jdt.core.dom.CompilationUnit.accept0(CompilationUnit.java:258)
	at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2971)
	at io.spring.javaformat.formatter.eclipse.DefaultCodeFormatter.prepareSpaces(DefaultCodeFormatter.java:412)
	at io.spring.javaformat.formatter.eclipse.DefaultCodeFormatter.prepareFormattedCode(DefaultCodeFormatter.java:229)
	at io.spring.javaformat.formatter.eclipse.DefaultCodeFormatter.format(DefaultCodeFormatter.java:186)
	at io.spring.javaformat.formatter.eclipse.DefaultCodeFormatter.format(DefaultCodeFormatter.java:168)
	at io.spring.javaformat.formatter.Formatter.lambda$format$0(Formatter.java:102)
	at io.spring.javaformat.formatter.Formatter.nlsSafe(Formatter.java:149)
	at io.spring.javaformat.formatter.Formatter.format(Formatter.java:101)
	at io.spring.javaformat.eclipse.formatter.SpringCodeFormatter.format(SpringCodeFormatter.java:39)
	at org.eclipse.jdt.internal.corext.util.CodeFormatterUtil.reformat(CodeFormatterUtil.java:291)
	at org.eclipse.jdt.internal.corext.util.CodeFormatterUtil.reformat(CodeFormatterUtil.java:354)
	at org.eclipse.jdt.internal.corext.fix.CodeFormatFix.createCleanUp(CodeFormatFix.java:76)
	at org.eclipse.jdt.internal.ui.fix.CodeFormatCleanUp.createFix(CodeFormatCleanUp.java:64)
	at 
...

Installation details:

eclipse.buildId=4.16.0.I20200604-0540
java.version=11.0.7-internal
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Command-line arguments:  -data file:/home/dsyer/dev/eclipse/workspace/ -os linux -ws gtk -arch x86_64
@dsyer dsyer changed the title IndexOutOfBounds on save IndexOutOfBounds on save and create new class Jul 7, 2020
@wilkinsona
Copy link
Contributor

This is a duplicate of #204 and #203.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants