Community
Participate
Working Groups
Created attachment 282014 [details] Sample project to reproduce the bug Used Eclipse Version: 2019-12 (4.14.0), Build id: 20191212-1212 Extract the appended zip and import the project (File -> Import... -> Existing Projects into Workspace -> select the directory, where you extracted the project to) Open the class Demo in a code editor tab, then open the type hierarchy (F4) -> A dialog pops up, saying: An internal error occurred during: "Computing type hierarchy of 'Demo - org.eclipse.bug.f4'...". Index 0 out of bounds for length 0 Open the Error Log (Window -> Show View -> Error Log) and open the event details. Stack Trace: java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0 at org.eclipse.jdt.internal.compiler.lookup.ModuleBinding.getOrCreateDeclaredPackage(ModuleBinding.java:339) at org.eclipse.jdt.internal.compiler.lookup.ModuleBinding$UnNamedModule.getDeclaredPackage(ModuleBinding.java:105) at org.eclipse.jdt.internal.compiler.lookup.ModuleBinding.combineWithPackagesFromOtherRelevantModules(ModuleBinding.java:670) at org.eclipse.jdt.internal.compiler.lookup.ModuleBinding.getVisiblePackage(ModuleBinding.java:615) at org.eclipse.jdt.internal.compiler.lookup.ModuleBinding.getTopLevelPackage(ModuleBinding.java:552) at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.getTopLevelPackage(LookupEnvironment.java:1652) at org.eclipse.jdt.internal.compiler.lookup.Scope.getTypeOrPackage(Scope.java:3442) at org.eclipse.jdt.internal.compiler.lookup.Scope.getType(Scope.java:3077) at org.eclipse.jdt.internal.compiler.ast.SingleTypeReference.getTypeBinding(SingleTypeReference.java:57) at org.eclipse.jdt.internal.compiler.ast.TypeReference.internalResolveType(TypeReference.java:528) at org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveType(TypeReference.java:629) at org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveTypeArgument(TypeReference.java:642) at org.eclipse.jdt.internal.compiler.ast.ParameterizedSingleTypeReference.internalResolveLeafType(ParameterizedSingleTypeReference.java:264) at org.eclipse.jdt.internal.compiler.ast.ParameterizedSingleTypeReference.internalResolveType(ParameterizedSingleTypeReference.java:174) at org.eclipse.jdt.internal.compiler.ast.ParameterizedSingleTypeReference.resolveType(ParameterizedSingleTypeReference.java:390) at org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveType(TypeReference.java:625) at org.eclipse.jdt.internal.compiler.ast.QualifiedAllocationExpression.resolveTypeForQualifiedAllocationExpression(QualifiedAllocationExpression.java:373) at org.eclipse.jdt.internal.compiler.ast.QualifiedAllocationExpression.resolveType(QualifiedAllocationExpression.java:303) at org.eclipse.jdt.internal.compiler.ast.Expression.resolve(Expression.java:1066) at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatements(AbstractMethodDeclaration.java:641) at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:316) at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:551) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1293) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1418) at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.resolve(CompilationUnitDeclaration.java:666) My Session Data is: eclipse.buildId=4.14.0.I20191210-0610 java.version=11.0.2 java.vendor=Oracle Corporation BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_GB Framework arguments: -product org.eclipse.epp.package.java.product Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product This problem does not occur, if one of following changes are made: - type inference isn't used: Change line 5 in class Demo to: GenericClass<String> anonymousClassInstance = new GenericClass<String>() {}; - the value of the attribute test in .classpath is changed to false (line 11) (Refresh the project in Eclipse after modifying the file.) It doesn't matter which library is used: As long as there is one classpathentry with attribute test set to true, the problem occurs. - the file src/main/java/module-info.java is removed
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.