Project: JDT
Bug 12101 NewTypeWizardPage.createType crashes in non-ui thread
Reported: 2002-03-22 06:30:27 | Status: resolved fixed

When performing the IRunnableWithProgress from NewTypeWizardPage.getRunnable, I get the stack-trace shown below. This is caused by a creation of the JavaTextTools object. Currently, my workaround is to call JavaPlugin.getDefault().getJavaTextTools() in the constructor of the class that I derive from NewTypeWizardPage. Stack trace: java/lang/Throwable.<init>()V java/lang/Throwable.<init>(Ljava/lang/String;)V java/lang/NullPointerException.<init>(Ljava/lang/String;)V org/eclipse/jdt/internal/ui/text/JavaColorManager.getColor(Lorg/eclipse/swt/graphics/RGB;)Lorg/eclipse/swt/graphics/Color; org/eclipse/jdt/internal/ui/text/JavaColorManager.getColor(Ljava/lang/String;)Lorg/eclipse/swt/graphics/Color; org/eclipse/jdt/internal/ui/text/AbstractJavaScanner.addToken(Ljava/lang/String;Ljava/lang/String;)V org/eclipse/jdt/internal/ui/text/AbstractJavaScanner.initialize()V org/eclipse/jdt/internal/ui/text/java/JavaCodeScanner.<init>(Lorg/eclipse/jdt/ui/text/IColorManager;Lorg/eclipse/jface/preference/IPreferenceStore;)V org/eclipse/jdt/ui/text/JavaTextTools.<init>(Lorg/eclipse/jface/preference/IPreferenceStore;)V org/eclipse/jdt/internal/ui/JavaPlugin.getJavaTextTools()Lorg/eclipse/jdt/ui/text/JavaTextTools; org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitDocumentProvider$BufferFactory.internalCreateDocument(Lorg/eclipse/ui/IFileEditorInput;)Lorg/eclipse/jface/text/IDocument; org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitDocumentProvider$BufferFactory.internalGetDocument(Lorg/eclipse/ui/IFileEditorInput;)Lorg/eclipse/jface/text/IDocument; org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitDocumentProvider$BufferFactory.createBuffer(Lorg/eclipse/jdt/core/IOpenable;)Lorg/eclipse/jdt/core/IBuffer; org/eclipse/jdt/internal/core/CompilationUnit.getWorkingCopy(Lorg/eclipse/core/runtime/IProgressMonitor;Lorg/eclipse/jdt/core/IBufferFactory;)Lorg/eclipse/jdt/core/IJavaElement; org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitDocumentProvider.createElementInfo(Ljava/lang/Object;)Lorg/eclipse/ui/texteditor/AbstractDocumentProvider$ElementInfo; org/eclipse/ui/texteditor/AbstractDocumentProvider.connect(Ljava/lang/Object;)V org/eclipse/jdt/internal/corext/textmanipulation/TextBufferFactory.acquire(Lorg/eclipse/core/resources/IFile;)Lorg/eclipse/jdt/internal/corext/textmanipulation/TextBuffer; org/eclipse/jdt/internal/corext/textmanipulation/TextBuffer.acquire(Lorg/eclipse/core/resources/IFile;)Lorg/eclipse/jdt/internal/corext/textmanipulation/TextBuffer; org/eclipse/jdt/internal/corext/codemanipulation/ImportsStructure.aquireTextBuffer()Lorg/eclipse/jdt/internal/corext/textmanipulation/TextBuffer; org/eclipse/jdt/internal/corext/codemanipulation/ImportsStructure.create(ZLorg/eclipse/core/runtime/IProgressMonitor;)V org/eclipse/jdt/ui/wizards/NewTypeWizardPage.createType(Lorg/eclipse/core/runtime/IProgressMonitor;)V org/eclipse/jdt/ui/wizards/NewTypeWizardPage$1.run(Lorg/eclipse/core/runtime/IProgressMonitor;)V com/ibm/ive/jxe/buildfile/RunnableActionExecutor.run(Lorg/eclipse/core/runtime/IProgressMonitor;)V org/eclipse/jface/operation/ModalContext$ModalContextThread.run()V

Files changed in fix:
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/wizards/NewTypeWizardPage.java