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

Bug 357511

Summary: Exception thrown by the delegate function is never caught
Product: z_Archived Reporter: Jing Qian <jqian>
Component: EDTAssignee: Project Inbox <edt.javagen-inbox>
Status: CLOSED FIXED QA Contact:
Severity: major    
Priority: P3 CC: carrollk, jeffdouglas, wxwu
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Jing Qian CLA 2011-09-13 11:20:15 EDT
try this in RBD and EDT, you will see different results

RBD is correct, the exception thrown by delegate function is being caught 
EDT is wrong, the exception thrown by delegate can not be caught by user. 

package c;

Record JingException type Exception
end

delegate runTest()
end

// basic program
//
program SimpleException type BasicProgram {}
	
	
	function main()
		d runTest = testFunction;
		try
			d();
		onException(exp JingException)
			sysLib.writeStdOut ("JingException caught, reason: " + exp.message);
		onException(exp AnyException)
			sysLib.writeStdOUt ("JingException NOT cought, that's wrong!!");
		end
	end
	
	function testFunction()
		throw new JingException{message = "I failed"};
	end
end
Comment 1 Jeff Douglas CLA 2011-09-14 12:19:03 EDT
fixed
Comment 2 Lisa Lasher CLA 2011-11-09 14:13:35 EST
This high severity defect was fixed several weeks ago, so I am closing.