Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 223876

Summary: [evaluations] force return fails with semi-colon and no "return" keyword
Product: [Eclipse Project] JDT Reporter: Curtis Windatt <curtis.windatt.public>
Component: DebugAssignee: JDT-Debug-Inbox <jdt-debug-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: darin.eclipse
Version: 3.4   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: stalebug

Description Curtis Windatt CLA 2008-03-25 11:59:02 EDT
While testing the force return feature, I started encountering odd errors while evaluating.  An error would come up saying that there was an error evaluating, the text of the dialog is "1".

I was using the ForceReturnTests class from the manual suite.  It seems to occur whenever an evaluation is done on an inner class in this file.  Here is one example.

/**
	 * Inner class for testing
	 */
	class D {
		private String fString;
		
		public D(String text) {
			fString = text;
		}
		
		public String toString() {
			return fString;
		}
	}

	/**
	 * tests getting a <code>D</code> value
	 * @return
	 */
	public D getObjectValue1() {
		D d = new D("orginal");
		return d; //TODO force return
	}

If you force return the variable d, everything works.  However, force returning 'new D("original");' with or without the semicolon, fails.  Inspect also failed.

Tested in both WinVista and WinXp
Comment 1 Darin Wright CLA 2009-06-09 14:57:17 EDT
Without the semicolon works in 3.5RC4
Comment 2 Darin Wright CLA 2009-06-09 15:03:43 EDT
With the semi-colon, it fails because the result is null (i.e. you need a "return XYZ;" for it to work. Inspect works in both cases (and results in null when there is a semi-colon).
Comment 3 Eclipse Genie CLA 2020-05-11 17:10:35 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.