| Summary: | [evaluation] Force early return | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Darin Wright <darin.eclipse> | ||||||||
| Component: | Debug | Assignee: | Curtis Windatt <curtis.windatt.public> | ||||||||
| Status: | VERIFIED FIXED | QA Contact: | |||||||||
| Severity: | enhancement | ||||||||||
| Priority: | P3 | CC: | carsten.hammer, Michael_Rennie, mlists | ||||||||
| Version: | 3.2 | ||||||||||
| Target Milestone: | 3.3 M6 | ||||||||||
| Hardware: | PC | ||||||||||
| OS: | Windows XP | ||||||||||
| Whiteboard: | |||||||||||
| Bug Depends on: | 174684 | ||||||||||
| Bug Blocks: | |||||||||||
| Attachments: |
|
||||||||||
|
Description
Darin Wright
Created attachment 59181 [details]
patch
Work in progress. Migrates debug action sets to use menus extension point to allow us to use commands and handlers for evaluation actions.
Created attachment 59310 [details]
upated patch
Filed bug 174684 against UI for activeWhen problem. Released new API to support this feature in the Java debugger. IJavaThread.canForceReturn() IJavaThread.forceReturn(IJavaValue) IJavaDebugTarget.supportsForceReturn() Added tests. Tests only run (to completion) on 1.6. Tests bail (but pass) when a VM does not support the feature. +1 *** Bug 154231 has been marked as a duplicate of this bug. *** Created attachment 60733 [details]
work in progress
updated patch
Fixed. Released new "Force Return" action with key-binding "Alt-Shift-F". Feature only enables on 1.6 and works for top and non-top stack frames as long as there are no native methods in the way (i.e. we can't force a return from a native method). I moved the API for forcing return from the IJavaThread to IJavaStackFrame to give more flexibility on implementation for non-top frames. This is a brand new API so it doesn't break anyone. Action appears in Run menu (top level), Java editor, Variables view, and Display View. I did not migrate to the new menu/commands extensions. We should do that work separately, time permitting. Please verify, Curtis. I added tests for force return in non-top frames as well. Verified Having enablesFor equal to '+' on the detail pane action is a little strange, since you don't need a selection in the display or editor views. An icon would be helpful. Maybe something like the step return icon, but with a red arrow instead of a yellow one. The code added here introduced the following bug that is still there in latest version: Bug: Call to String.equals(org.eclipse.jdt.debug.core.IJavaValue) in org.eclipse.jdt.internal.debug.ui.actions.ForceReturnAction.displayResult(IEvaluationResult) This method calls equals(Object) on two references, one of which is a class and the other an interface, where neither the class nor any of its non-abstract subclasses implement the interface. Therefore, the objects being compared are unlikely to be members of the same class at runtime (unless some application classes were not analyzed, or dynamic class loading can occur at runtime). According to the contract of equals(), objects of different classes should always compare as unequal; therefore, according to the contract defined by java.lang.Object.equals(Object), the result of this comparison will always be false at runtime. Rank: Scariest (4), confidence: High Pattern: EC_UNRELATED_CLASS_AND_INTERFACE Type: EC, Category: CORRECTNESS (Correctness)<hr size="1" /> At ForceReturnAction.java:[line 65] In method org.eclipse.jdt.internal.debug.ui.actions.ForceReturnAction.displayResult(IEvaluationResult) Actual type org.eclipse.jdt.debug.core.IJavaValue Expected String Value loaded from value String constant "V" String.equals(Object) used to determine equality |