Bug 29696 JavaMarkerAnnotation.initialize() can be called in non UI thread.
Build I20020315 Refactoring uses documents and annotation models to actual perform the textual changes. Since refactoring operations can be executed in a non UI thread (e.g. when executed as an operation) the JavaMarkerAnnotation.initialize() method may be called in a non UI thread resulting in an assertion failure due to image creation. Caused by: org.eclipse.jface.util.Assert$AssertionFailedException: null argument; at org.eclipse.jface.util.Assert.isNotNull(Assert.java:133) at org.eclipse.jface.util.Assert.isNotNull(Assert.java:110) at org.eclipse.jface.resource.ImageRegistry.<init> (ImageRegistry.java:51) at org.eclipse.jdt.internal.ui.JavaPluginImages.getImageRegistry (JavaPluginImages.java:341) at org.eclipse.jdt.internal.ui.JavaPluginImages.get (JavaPluginImages.java:317) at org.eclipse.jdt.internal.ui.javaeditor.JavaMarkerAnnotation.initialize (JavaMarkerAnnotation.java:111) at org.eclipse.ui.texteditor.MarkerAnnotation.<init> (MarkerAnnotation.java:111) at org.eclipse.jdt.internal.ui.javaeditor.JavaMarkerAnnotation.<init> (JavaMarkerAnnotation.java:53) at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider$Compilati onUnitAnnotationModel.createMarkerAnnotation (CompilationUnitDocumentProvider.java:381) at org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel.addMarkerAnnotation (AbstractMarkerAnnotationModel.java:215) at org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel.catchupWithMarkers (AbstractMarkerAnnotationModel.java:394) at org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel.connected (AbstractMarkerAnnotationModel.java:228) at org.eclipse.jface.text.source.AnnotationModel.connect (AnnotationModel.java:139) at org.eclipse.jdt.internal.corext.textmanipulation.TextBufferFactory.acquire (TextBufferFactory.java:88) at org.eclipse.jdt.internal.corext.textmanipulation.TextBuffer.acquire (TextBuffer.java:371) at org.eclipse.jdt.internal.corext.codemanipulation.ImportsStructure.aquireTextBuff er(ImportsStructure.java:538) at org.eclipse.jdt.internal.corext.codemanipulation.ImportsStructure.<init> (ImportsStructure.java:85) at org.eclipse.jdt.internal.corext.codemanipulation.ImportEdit.<init> (ImportEdit.java:33) at org.eclipse.jdt.internal.corext.refactoring.reorg.MoveCuUpdateCreator.getImportE dit(MoveCuUpdateCreator.java:217) at org.eclipse.jdt.internal.corext.refactoring.reorg.MoveCuUpdateCreator.addImport (MoveCuUpdateCreator.java:208) at org.eclipse.jdt.internal.corext.refactoring.reorg.MoveCuUpdateCreator.addImports ToDestinationPackage(MoveCuUpdateCreator.java:199) at org.eclipse.jdt.internal.corext.refactoring.reorg.MoveCuUpdateCreator.createChan geManager(MoveCuUpdateCreator.java:89) at org.eclipse.jdt.internal.corext.refactoring.reorg.MoveRefactoring.createChangeMa nager(MoveRefactoring.java:475) at org.eclipse.jdt.internal.corext.refactoring.reorg.MoveRefactoring.checkInput (MoveRefactoring.java:158) at org.eclipse.jdt.internal.ui.refactoring.CheckConditionsOperation.run (CheckConditionsOperation.java:59) at org.eclipse.jdt.internal.ui.refactoring.CreateChangeOperation.run (CreateChangeOperation.java:94) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run (ModalContext.java:95)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaMarkerAnnotation.java
/**********************************************************************
Copyright (c) 2000, 2003 IBM Corp. and others.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Common Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/cpl-v10.html
Contributors:
    IBM Corporation - Initial implementation
**********************************************************************/
package org.eclipse.jdt.internal.ui.javaeditor;
import java.util.Iterator;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.model.IBreakpoint;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Display;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.jface.text.Assert;
import org.eclipse.ui.texteditor.MarkerAnnotation;