Community
Participate
Working Groups
I have an enum that triggers an IOOBE whenever I try to invoke content assist on it. java.lang.IndexOutOfBoundsException: Index -1 out of bounds for length 0 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 org.eclipse.jdt.core.dom.ASTNode$NodeList.get(ASTNode.java:1432) at org.eclipse.jdt.core.dom.ASTConverter.checkAndAddMultipleFieldDeclaration(ASTConverter.java:443) at org.eclipse.jdt.core.dom.ASTConverter.buildBodyDeclarations(ASTConverter.java:269) at org.eclipse.jdt.core.dom.ASTConverter.convertToEnumDeclaration(ASTConverter.java:3274) at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:2972) at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1393) at org.eclipse.jdt.core.dom.AST.convertCompilationUnit(AST.java:367) at org.eclipse.jdt.internal.core.CompilationUnit.buildStructure(CompilationUnit.java:202) at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:268) at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:596) at org.eclipse.jdt.internal.core.CompilationUnit.makeConsistent(CompilationUnit.java:1145) at org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.makeConsistent(ReconcileWorkingCopyOperation.java:173) at org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.executeOperation(ReconcileWorkingCopyOperation.java:94) at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:736) at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:802) at org.eclipse.jdt.internal.core.CompilationUnit.reconcile(CompilationUnit.java:1322) at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:131) at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.access$0(JavaReconcilingStrategy.java:113) at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy$1.run(JavaReconcilingStrategy.java:93) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:90) at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:157) at org.eclipse.jdt.internal.ui.text.CompositeReconcilingStrategy.reconcile(CompositeReconcilingStrategy.java:92) at org.eclipse.jdt.internal.ui.text.JavaCompositeReconcilingStrategy.reconcile(JavaCompositeReconcilingStrategy.java:107) at org.eclipse.jface.text.reconciler.MonoReconciler.process(MonoReconciler.java:76) at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:210)
Created attachment 278026 [details] sample source which produced the problem This source produced the problem initially. I'm unable to reproduce the exceptions a second time. However, code completion in the cursor position produces no proposals. Something is off here.
I can't reproduce the exception either. But if I change the code slightly, I see completion being proposed: LOG_EVENT((byte) 0, (new OtherClassInSamePackage<Str>()).SOME_STRING_CONSTANT_A), Without the instantiation, statically accessing the class with type argument will result in a compilation error. So, I don't think there need to be any proposal. Am I missing something?
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.
Still occurs in Eclipse RCP 2021-06, Windows 10, Java 11, with exact same stack trace as in comment0