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
import org.eclipse.ui.texteditor.MarkerUtilities;
import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.debug.ui.IDebugModelPresentation;
import org.eclipse.search.ui.SearchUI;
import org.eclipse.jdt.core.IJavaModelMarker;
import org.eclipse.jdt.ui.PreferenceConstants;
import org.eclipse.jdt.internal.core.Util;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.JavaPluginImages;
import org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor;
public class JavaMarkerAnnotation extends MarkerAnnotation implements IJavaAnnotation {
	
	private static final int NO_IMAGE= 0;
	private static final int ORIGINAL_MARKER_IMAGE= 1;
	private static final int QUICKFIX_IMAGE= 2;
	private static final int QUICKFIX_ERROR_IMAGE= 3;
	private static final int OVERLAY_IMAGE= 4;
	private static final int GRAY_IMAGE= 5;
	private static final int BREAKPOINT_IMAGE= 6;
	private static Image fgQuickFixImage;
	private static Image fgQuickFixErrorImage;
	private static ImageRegistry fgGrayMarkersImageRegistry;
	
	private IDebugModelPresentation fPresentation;
	private IJavaAnnotation fOverlay;
	private boolean fNotRelevant= false;
	private AnnotationType fType;
	private int fImageType;
	private boolean fQuickFixIconEnabled;