Bug 567191 - Type hierarchy fails with StringIndexOutOfBoundsException
Summary: Type hierarchy fails with StringIndexOutOfBoundsException
Status: CLOSED DUPLICATE of bug 567319
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.17   Edit
Hardware: PC Windows 10
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2020-09-21 06:01 EDT by Michael Schnell CLA
Modified: 2020-10-23 11:04 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Schnell CLA 2020-09-21 06:01:27 EDT
The type hierarchy view fails to display any hierarchy.

Steps to reproduce.
- Open type hierarchy for any type (e.g. press F4 on java.lang.String)
- An error dialog pops up
- The type hierarchy view is empty


Error details:

eclipse.buildId=4.17.0.I20200902-1800
java.fullversion=11.0.4+11
JRE 11 Windows 8 amd64-64-Bit Compressed References 20190717_282 (JIT enabled, AOT enabled)
OpenJ9   - 0f66c6431
OMR      - ec782f26
JCL      - fa49279450 based on jdk-11.0.4+11
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=de_DE
Framework arguments:  -product org.eclipse.epp.package.jee.product -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product -product org.eclipse.epp.package.jee.product

org.eclipse.core.jobs
Error
Mon Sep 21 11:51:50 CEST 2020
An internal error occurred during: "Computing type hierarchy of 'String - java.lang'...".

java.lang.StringIndexOutOfBoundsException
	at java.base/java.lang.String.<init>(String.java:738)
	at org.eclipse.jdt.internal.compiler.parser.Scanner.disambiguatedToken(Scanner.java:5491)
	at org.eclipse.jdt.internal.compiler.parser.Scanner.getNextToken(Scanner.java:1461)
	at org.eclipse.jdt.internal.compiler.parser.diagnose.LexStream.readTokenFromScanner(LexStream.java:84)
	at org.eclipse.jdt.internal.compiler.parser.diagnose.LexStream.token(LexStream.java:154)
	at org.eclipse.jdt.internal.compiler.parser.diagnose.LexStream.kind(LexStream.java:194)
	at org.eclipse.jdt.internal.compiler.parser.diagnose.DiagnoseParser.diagnoseParse(DiagnoseParser.java:312)
	at org.eclipse.jdt.internal.compiler.parser.Parser.reportSyntaxErrors(Parser.java:14010)
	at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:12857)
	at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:13051)
	at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:13008)
	at org.eclipse.jdt.internal.compiler.parser.SourceTypeConverter.convert(SourceTypeConverter.java:144)
	at org.eclipse.jdt.internal.compiler.parser.SourceTypeConverter.buildCompilationUnit(SourceTypeConverter.java:100)
	at org.eclipse.jdt.internal.core.hierarchy.HierarchyResolver.resolve(HierarchyResolver.java:755)
	at org.eclipse.jdt.internal.core.hierarchy.IndexBasedHierarchyBuilder.buildForProject(IndexBasedHierarchyBuilder.java:265)
	at org.eclipse.jdt.internal.core.hierarchy.IndexBasedHierarchyBuilder.buildFromPotentialSubtypes(IndexBasedHierarchyBuilder.java:350)
	at org.eclipse.jdt.internal.core.hierarchy.IndexBasedHierarchyBuilder.build(IndexBasedHierarchyBuilder.java:166)
	at org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy.compute(TypeHierarchy.java:323)
	at org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy.refresh(TypeHierarchy.java:1319)
	at org.eclipse.jdt.internal.core.CreateTypeHierarchyOperation.executeOperation(CreateTypeHierarchyOperation.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.BinaryType.newTypeHierarchy(BinaryType.java:938)
	at org.eclipse.jdt.internal.core.BinaryType.newTypeHierarchy(BinaryType.java:897)
	at org.eclipse.jdt.internal.ui.typehierarchy.TypeHierarchyLifeCycle.createTypeHierarchy(TypeHierarchyLifeCycle.java:295)
	at org.eclipse.jdt.internal.ui.typehierarchy.TypeHierarchyLifeCycle.doHierarchyRefresh(TypeHierarchyLifeCycle.java:325)
	at org.eclipse.jdt.internal.ui.typehierarchy.TypeHierarchyLifeCycle.doHierarchyRefreshBackground(TypeHierarchyLifeCycle.java:272)
	at org.eclipse.jdt.internal.ui.typehierarchy.TypeHierarchyLifeCycle$1.run(TypeHierarchyLifeCycle.java:225)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Comment 1 Andrey Loskutov CLA 2020-09-21 06:28:02 EDT
You are running Eclipse on OpenJ9? I can't reproduce that on OpenJDK 11. Can you  please double check that, if the problem appears if using OpenJ9?
Comment 2 Michael Schnell CLA 2020-09-22 04:29:14 EDT
Hi Andrey,

thank you for looking into this.

Before I reported this issue, I could reproduce it for every Java type even after reopening the view and manually restarting the eclipse instance.

To test the issue with a different Java VM I added the -vm command line argument in eclipse.ini. After changing to the hotspot VM of the same version (11.0.4+11) the issue disappeared!

To double check I used the -vm option to select the OpenJ9 again, but couldn't reproduce the issue. Then I removed the -vm option again reverting to the original eclipse.ini, but still could not reproduce the issue.

Feels like switching the JVM cleared some cached value...


tl;dr

I cannot reproduce the issue any more. So I will close it now.
Comment 3 Manoj N Palat CLA 2020-09-29 00:58:52 EDT
I think this is identical to bug 567319
Comment 4 Andrey Loskutov CLA 2020-10-23 11:04:45 EDT

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