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
public JavaMarkerAnnotation(IMarker marker) {
		super(marker);
	}
	
	/*
	 * @see MarkerAnnotation#getUnknownImageName(IMarker)
	 */
	protected String getUnknownImageName(IMarker marker) {
		return JavaPluginImages.IMG_OBJS_GHOST;
	}
	
	/**
	 * Initializes the annotation's icon representation and its drawing layer
	 * based upon the properties of the underlying marker.
	 */
	protected void initialize() {
		fQuickFixIconEnabled= PreferenceConstants.getPreferenceStore().getBoolean(PreferenceConstants.EDITOR_CORRECTION_INDICATION);
		fImageType= NO_IMAGE;
		IMarker marker= getMarker();
		
		if (MarkerUtilities.isMarkerType(marker, IBreakpoint.BREAKPOINT_MARKER)) {
			
			if (fPresentation == null) 
				fPresentation= DebugUITools.newDebugModelPresentation();
				
			setLayer(4);
			setImage(fPresentation.getImage(marker));
			fImageType= BREAKPOINT_IMAGE;