Bug 5075 Class cast extception in JavaOutliner
* Using latest code (204++) * Using Junit as a test case * Put a breakpoint in VectorTest#testElementAt(), on the second line of the method * Open a class file editor in the Java Perspective, and make it the active editor (I openned Vector.class) * Debug to the breakpoint * Try to inspect or display "i.intValue == 1" * ClassCastException this= Workbench (id=49) e= SWTException (id=190) backtrace= Object[10] (id=192) code= 46 detailMessage= "Failed to execute runnable" throwable= ClassCastException (id=193) backtrace= Object[11] (id=194) [0]= int[10] (id=196) [1]= Class (org.eclipse.jdt.internal.ui.javaeditor.JavaOutlinePage$1) (id=74) [2]= Class (org.eclipse.swt.widgets.RunnableLock) (id=75) [3]= Class (org.eclipse.swt.widgets.Synchronizer) (id=76) [4]= Class (org.eclipse.swt.widgets.Display) (id=77) [5]= Class (org.eclipse.swt.widgets.Display) (id=77) [6]= Class (org.eclipse.ui.internal.Workbench) (id=40) [7]= Class (org.eclipse.ui.internal.Workbench) (id=40) [8]= Class (org.eclipse.core.internal.boot.InternalBootLoader) (id=46) [9]= Class (org.eclipse.core.boot.BootLoader) (id=47) [10]= Class (SlimLauncher) (id=48) detailMessage= "org.eclipse.jdt.internal.core.ClassFile" msg= "Failed to execute runnable (org.eclipse.jdt.internal.core.ClassFile)"
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaOutlinePage.java
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaElementDelta;
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IParent;
import org.eclipse.jdt.core.ISourceRange;
import org.eclipse.jdt.core.ISourceReference;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.ui.IContextMenuConstants;
import org.eclipse.jdt.ui.JavaElementLabelProvider;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.JavaPluginImages;
import org.eclipse.jdt.internal.ui.actions.ContextMenuGroup;
import org.eclipse.jdt.internal.ui.actions.GenerateGroup;
import org.eclipse.jdt.internal.ui.actions.OpenHierarchyPerspectiveItem;
import org.eclipse.jdt.internal.ui.refactoring.actions.RefactoringGroup;
import org.eclipse.jdt.internal.ui.reorg.ReorgGroup;
import org.eclipse.jdt.internal.ui.search.JavaSearchGroup;
import org.eclipse.jdt.internal.ui.util.JavaModelUtil;
import org.eclipse.jdt.internal.ui.util.OpenTypeHierarchyUtil;
import org.eclipse.jdt.internal.ui.viewsupport.JavaElementSorter;
import org.eclipse.jdt.internal.ui.viewsupport.StatusBarUpdater;
/**
 * The content outline page of the Java editor. The viewer implements a proprietary
 * update mechanism based on Java model deltas. It does not react on domain changes.
 * It is specified to show the content of ICompilationUnits and IClassFiles.
 */
class JavaOutlinePage extends Page implements IContentOutlinePage {