Bug 5225 1.0 -- Casting problem in RunToLineAction class
The Java editor fails to open a java source file when we have PICLDebugTargets in the debug view. There is java.lang.ClassCastException at org.eclipse.jdt.internal.ui.javaeditor.RunToLineAction.getContextFromModel (RunToLineAction.java:111) The getContextFromModel() method incorrectly assumes that all debug targets are of type JDIDebugTarget. I see a few other spots in RunToLineAction where a debug target is blindly cast to a JDIDebugTarget without checking it first. I am seeing this with the R1.0 (0.137 build) driver. I don't think this is a new problem.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/RunToLineAction.java
package org.eclipse.jdt.internal.ui.javaeditor;
/*
 * (c) Copyright IBM Corp. 2000, 2001.
 * All Rights Reserved.
 */
import org.eclipse.core.runtime.IStatus;
import org.eclipse.debug.core.*;
import org.eclipse.debug.core.model.*;
import org.eclipse.debug.ui.IDebugUIConstants;
import org.eclipse.jdt.core.*;
import org.eclipse.jdt.debug.core.JDIDebugModel;
import org.eclipse.jdt.internal.debug.core.JDIDebugTarget;
import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.text.ITextSelection;
import org.eclipse.jface.viewers.*;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.help.WorkbenchHelp;
import org.eclipse.ui.texteditor.IUpdate;
/**
 * Action to support run to line (i.e. where the cursor is)
 */
public class RunToLineAction extends Action implements IUpdate {