Bug 67187 [implementation] Concurrent modification of CompilationUnitDocumentProvider's ReverseMap
Was just scrolling through a Java file and got a popup with the following info: Java AST creation (Error: An internal error occurred during: "Java AST creation".) An internal error occurred during: "Java AST creation". java.lang.IndexOutOfBoundsException: Index: 62, Size: 60 java.util.ArrayList.RangeCheck(ArrayList.java:507) java.util.ArrayList.get(ArrayList.java:324) org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider$ReverseM ap.get(CompilationUnitDocumentProvider.java:325) org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider$Compilat ionUnitAnnotationModel.addAnnotation(CompilationUnitDocumentProvider.java:665) org.eclipse.jface.text.source.AnnotationModel.addAnnotation (AnnotationModel.java:163) org.eclipse.jdt.internal.ui.text.correction.QuickAssistLightBulbUpdater.calcula teLightBulb(QuickAssistLightBulbUpdater.java:233) org.eclipse.jdt.internal.ui.text.correction.QuickAssistLightBulbUpdater.doSelec tionChanged(QuickAssistLightBulbUpdater.java:221) org.eclipse.jdt.internal.ui.text.correction.QuickAssistLightBulbUpdater.access$ 0(QuickAssistLightBulbUpdater.java:204) org.eclipse.jdt.internal.ui.text.correction.QuickAssistLightBulbUpdater$1.selec tionChanged(QuickAssistLightBulbUpdater.java:128) org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartLis tenerGroup.calculateASTandInform(SelectionListenerWithASTManager.java:164) org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$3.run (SelectionListenerWithASTManager.java:136) org.eclipse.core.internal.jobs.Worker.run(Worker.java:66) Wasn't doing anything remarkable at the time - certainly nothing that I would expect would induce this...
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitDocumentProvider.java
IMarker[] markers= r.findMarkers(IMarker.MARKER, true, IResource.DEPTH_ZERO);
				if (markers != null && markers.length > 0) {
					AbstractMarkerAnnotationModel model= (AbstractMarkerAnnotationModel) info.fModel;						
					for (int i= 0; i < markers.length; i++)
						model.updateMarker(document, markers[i], null);
				}
			}
		}
	}
	
	/*
	 * @see org.eclipse.ui.editors.text.TextFileDocumentProvider#createSaveOperation(java.lang.Object, org.eclipse.jface.text.IDocument, boolean)
	 */
	protected DocumentProviderOperation createSaveOperation(final Object element, final IDocument document, final boolean overwrite) throws CoreException {
		final FileInfo info= getFileInfo(element);
		if (info instanceof CompilationUnitInfo) {
			return new DocumentProviderOperation() {
				/*
				 * @see org.eclipse.ui.editors.text.TextFileDocumentProvider.DocumentProviderOperation#execute(org.eclipse.core.runtime.IProgressMonitor)
				 */
				protected void execute(IProgressMonitor monitor) throws CoreException {
					commitWorkingCopy(monitor, element, (CompilationUnitInfo) info, overwrite);
				}
				/*
				 * @see org.eclipse.ui.editors.text.TextFileDocumentProvider.DocumentProviderOperation#getSchedulingRule()
				 */
				public ISchedulingRule getSchedulingRule() {
					if (info.fElement instanceof IFileEditorInput) {
						IFile file= ((IFileEditorInput) info.fElement).getFile();
						return computeSchedulingRule(file);