Bug 97214 [misc] Opening a generated *.class file throws IllegalStateException
3.1 RC1 Opening a generated *.class file throws IllegalStateException !ENTRY org.eclipse.jdt.ui 4 2 2005-05-30 12:38:04.976 !MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jdt.ui". !STACK 0 java.lang.IllegalStateException at org.eclipse.jdt.core.dom.ASTParser.internalCreateAST(ASTParser.java:752) at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:576) at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider$1.run(ASTProvider.java:577) at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1038) at org.eclipse.core.runtime.Platform.run(Platform.java:775) at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.createAST(ASTProvider.java:574) at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.getAST(ASTProvider.java:495) at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor$7.run(JavaEditor.java:3092) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:67)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/ASTProvider.java
}
	/**
	 * Creates a new compilation unit AST.
	 *
	 * @param je the Java element for which to create the AST
	 * @param progressMonitor the progress monitor
	 * @return AST
	 */
	private CompilationUnit createAST(IJavaElement je, final IProgressMonitor progressMonitor) {
		try {
			if (!(je instanceof ISourceReference) || ((ISourceReference)je).getSource() == null)
				return null;
		} catch (JavaModelException ex) {
			IStatus status= new Status(IStatus.ERROR, JavaUI.ID_PLUGIN, IStatus.OK, "Error in JDT Core during AST creation", ex);  
			JavaPlugin.getDefault().getLog().log(status);
			return null;
		}
		
		final ASTParser parser = ASTParser.newParser(AST_LEVEL);
		parser.setResolveBindings(true);
		if (je.getElementType() == IJavaElement.COMPILATION_UNIT)
			parser.setSource((ICompilationUnit)je);
		else if (je.getElementType() == IJavaElement.CLASS_FILE)
			parser.setSource((IClassFile)je);
		if (progressMonitor != null && progressMonitor.isCanceled())
			return null;
		final CompilationUnit root[]= new CompilationUnit[1]; 
		
		Platform.run(new ISafeRunnable() {
			public void run() {