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

Bug 354944

Summary: Generated Java has unreachable code
Product: z_Archived Reporter: Kathy Carroll <carrollk>
Component: EDTAssignee: Project Inbox <edt.mofmodel-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jeffdouglas, mheitz
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Kathy Carroll CLA 2011-08-17 08:24:51 EDT
package explore;

// basic library
library Tester  {}
	function executeLibTest(testName String) returns (MultiStatus)
		testMethods String[] = "runTestType01", "runTestType02"];
		runTestMtds runTestMethod[];
		return (runMultiTest(testMethods, runTestMtds, testName));
	end
	
	function runMultiTest(testMethods String[], runTestMtd runTestMethod[], testName String) returns (MultiStatus)
		ms MultiStatus;		
		return (ms);							
	end	
end
Record MultiStatus
	//these values accumulate the aggregate outcome, without 
	//requiring the individual outcomes be stored
	testCnt int;
	expectedCnt int;
end
delegate runTestMethod()	
end
Comment 1 Matt Heitz CLA 2011-08-18 13:52:31 EDT
This is actually a problem with the code expansion utility.  It inserts a line of code after the return statement for each inout and out parameter.  The return statement should be last.

The same kind of problem could happen with throw and transfer statements.  We don't support transfer in 0.7, so feel free to handle that one later.
Comment 2 Kathy Carroll CLA 2011-09-15 14:29:26 EDT
Problem still happens with install build 201109150902.

If make runMultiTest's testName paramater an in parameter, generated Java is OK.
Comment 3 Jeff Douglas CLA 2011-09-24 14:28:33 EDT
fixed
Comment 4 Kathy Carroll CLA 2011-09-26 09:13:26 EDT
201109242101
Comment 5 Lisa Lasher CLA 2011-10-11 16:19:42 EDT
Closing this defect.