突然之间Eclipse停止打开一个特定文件。它是一个类文件,但是同一个JAR和包中的其他类文件可以毫无问题地打开。可以毫无问题地打开与该类对应的Java文件。
错误消息是:
无法创建部分控件
java.lang.StringIndexOutOfBoundsException: String index out of range: 1
at java.lang.String.charAt(Unknown Source)
at org.eclipse.jdt.internal.core.SourceMapper.getUnqualifiedTypeSignature(SourceMapper.java:1308)
at org.eclipse.jdt.internal.core.SourceMapper.getUnqualifiedMethodHandle(SourceMapper.java:1262)
at org.eclipse.jdt.internal.core.SourceMapper.getSourceRange(SourceMapper.java:1191)
at org.eclipse.jdt.internal.core.BinaryMember.getSourceRange(BinaryMember.java:144)
at org.eclipse.jdt.ui.text.folding.DefaultJavaFoldingStructureProvider.computeProjectionRanges(DefaultJavaFoldingStructureProvider.java:1098)
at org.eclipse.jdt.ui.text.folding.DefaultJavaFoldingStructureProvider.computeFoldingStructure(DefaultJavaFoldingStructureProvider.java:1026)
at org.eclipse.jdt.ui.text.folding.DefaultJavaFoldingStructureProvider.computeFoldingStructure(DefaultJavaFoldingStructureProvider.java:976)
at org.eclipse.jdt.ui.text.folding.DefaultJavaFoldingStructureProvider.computeFoldingStructure(DefaultJavaFoldingStructureProvider.java:980)
at org.eclipse.jdt.ui.text.folding.DefaultJavaFoldingStructureProvider.computeFoldingStructure(DefaultJavaFoldingStructureProvider.java:967)
at org.eclipse.jdt.ui.text.folding.DefaultJavaFoldingStructureProvider.update(DefaultJavaFoldingStructureProvider.java:884)
at org.eclipse.jdt.ui.text.folding.DefaultJavaFoldingStructureProvider.initialize(DefaultJavaFoldingStructureProvider.java:829)
at org.eclipse.jdt.ui.text.folding.DefaultJavaFoldingStructureProvider.handleProjectionEnabled(DefaultJavaFoldingStructureProvider.java:800)
at org.eclipse.jdt.ui.text.folding.DefaultJavaFoldingStructureProvider$ProjectionListener.projectionEnabled(DefaultJavaFoldingStructureProvider.java:681)
at org.eclipse.jface.text.source.projection.ProjectionViewer.fireProjectionEnabled(ProjectionViewer.java:488)
at org.eclipse.jface.text.source.projection.ProjectionViewer.enableProjection(ProjectionViewer.java:536)
at org.eclipse.jdt.internal.ui.javaeditor.JavaSourceViewer.setVisibleDocument(JavaSourceViewer.java:681)
at org.eclipse.jface.text.TextViewer.setDocument(TextViewer.java:2934)
在大声抱怨之后,我的其他同事告诉我他们与其他文件有同样的问题,并且重新启动Eclipse" /"清洁和刷新狂欢" /"创建一个新工作区" /"安装新的Eclipse版本"不会让问题消失(我只能确认前三个)。
可能是什么问题?我该如何解决?我怎么能在将来阻止它?
This question looks similar,但堆栈跟踪完全不同。这是source of SourceMapper(它对我没有帮助)。